Re: EOF operation ordering
Re: EOF operation ordering
- Subject: Re: EOF operation ordering
- From: Chuck Hill <email@hidden>
- Date: Tue, 19 Feb 2008 12:02:34 -0800
On Feb 19, 2008, at 9:01 AM, David Avendasora wrote:
I'm using Chuck's extensions with MS SQL Server and they are a
godsend. My database has all constraints turned on and WO orders
its operations perfectly. I'm pretty sure VI works well, but soon
after Chuck's fix I actually saw the light and got rid of my VI and
switched to Single Table Inheritance for those instances so I never
actually deployed VI on MSSQL.
There is still a problem with Single Table Inheritance with Chuck's
code when it comes to subclasses that reference their superclass,
which means in the DB you have tables that have FKs pointing back
to their own PK. Chuck's code orders operations based on DB Table
dependancies, so it sees this arrangement as being circular. It
would need to look at every entity to be inserted and verify that
the row representing the superclass is inserted prior to the row
for the subclass to avoid any possibility of running afoul of a
constraint.
Which is on my list of things to do. Sometime.... :-)
In my situation, I know for a fact (due to business rules in the
application) that the super will always exist in the DB prior to
the subclass being instantiated, let alone saved, so I changed his
code to not treat this type of a relationship as circular, because
in _my_ situation it isn't. Depending on your business rules this
may or may not be the case.
I think part of that was a bug, but I want to re-think some of this
before I commit the change.
I don't currently use any Horizontal Inheritance (which would have
actually avoided the self-referencing tables problem outlined
above) so I can't speak for it's capabilities.
The Single Table problem might have been what I was thinking of.
I owe Chuck hugely for this code and his willingness to revisit it
when I've had issues (usually my own, shocking, I know). It is
completely transparent to the application with the simple addition
of one line of code to the Application class. I get the warm-
fuzzies just thinking about it. That and make sure ERExtensions
framework loads before the WO frameworks do.
ERExtensions loads after for me (again, on my To Do list of things to
fix) and it still works.
Chuck
On Feb 19, 2008, at 11:07 AM, Chuck Hill wrote:
I don't ever recall WO/EOF ordering the operations correctly in
any dependable manner. Either you do it in your code, or it is
subject to the whims of EOF implementation.
I wrote these classes so that I could use MS SQLServer which does
not support deferred constraints. See these Wonder classes:
com.webobjects.eoaccess.ERXEntityDependencyOrderingDelegate
com.webobjects.eoaccess.ERXAdaptorOpComparator
er.extensions.eoaccess.entityordering.ERXEntityOrder
er.extensions.eoaccess.entityordering.ERXEntityFKConstraintOrder
er.extensions.eoaccess.ERXDatabaseContextMulticastingDelegate
I use this with Single Table inheritance and it works. It work (I
think) with Vertical Inheritance (thanks to David Avendasora). I
think there are still some glitches with Horizontal Inheritance.
Bug reports welcome! Bug reports with example model and code very
welcome!
Chuck
On Feb 19, 2008, at 7:56 AM, Mike Schrag wrote:
Chuck wrote an operation ordering delegate in Wonder to support
MSSQL (which doesn't support deferrable) that might be helpful here.
ms
On Feb 19, 2008, at 10:43 AM, Dov Rosenberg wrote:
We have had to resort to deferred constraints for Oracle. For
SQL Server we
have had to disable the constraints. I am certainly interested
in a more
portable solution.
Dov Rosenberg
On 2/19/08 10:37 AM, "Pierre Bernard" <webobjects-
email@hidden> wrote:
Hi!
Back in the day of WO 4.5 to WO 5.1, I worked on a project
where we
relied on EOF's capability to order database operations.
Actually we
even extended the mechanism using a database context delegate
to apply
further sorting to already sorted operations.
On more recent projects, I always set contraints to be
deferrable and
was thus not bothered by problems of operation ordering.
Today, I get a call from a former colleague who wants a new
project to
be set up like past common project: non deferrable constraints.
It turns out that on WO 5.2 this doesn't seem to work as
expected. The
database complains as the operations are not correctly ordered.
Did WO 5.2 break operation ordering? Has it become optional?
(I have not seen the EOModel in question. I wonder if it has
circular
references which may prevent proper ordering.)
Show of hands: who uses deferrable constraints, who relies on
operation ordering?
Pierre
- - -
Houdah Software s. à r. l.
http://www.houdah.com
HoudahGeo: One-stop photo geocoding
HoudahSpot: Powerful Spotlight frontend
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
@inquira.com
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40mdimension.com
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40global-village.net
This email sent to email@hidden
--
Practical WebObjects - for developers who want to increase their
overall knowledge of WebObjects or who are trying to solve
specific problems.
http://www.global-village.net/products/practical_webobjects
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40avendasora.com
This email sent to email@hidden
--
Practical WebObjects - for developers who want to increase their
overall knowledge of WebObjects or who are trying to solve specific
problems.
http://www.global-village.net/products/practical_webobjects
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden