One property:

com.webobjects.eoaccess.ERXEntityDependencyOrderingDelegate.active = true

took care of it.

WOnderful! 

Steve

> On May 25, 2017, at 12:15 PM, Chuck Hill <[email protected]> wrote:
> 
> That is in Wonder now, IIRC.
>  
> The other thing to do, if you database supports it, is to mark the 
> constraints as DEFERRABLE INITIALLY DEFERRED.  The delegate was intended to 
> handle the cases where the database did not support that.
>  
> Chuck
>  
>  
> From: Webobjects-dev 
> <[email protected] 
> <mailto:[email protected]>> on 
> behalf of Aaron Rosenzweig <[email protected] <mailto:[email protected]>>
> Date: Thursday, May 25, 2017 at 8:32 AM
> To: Steve Peery <[email protected] <mailto:[email protected]>>
> Cc: WebObjects Development <[email protected] 
> <mailto:[email protected]>>
> Subject: Re: Save order of EO objects to support database foreign key 
> constraints.
>  
> Hi Steve, 
>  
> You can make a delegate to handle the ordering of database operations.
>  
> Chuck Hill made one that might just work for you but if you need something 
> additionally custom you’ll have to take over.
> https://lists.apple.com/archives/webobjects-dev/2007/Jun/msg00751.html 
> <https://lists.apple.com/archives/webobjects-dev/2007/Jun/msg00751.html>
>  
> AARON ROSENZWEIG / Chat 'n Bike <http://www.chatnbike.com/>
> e:  [email protected] <mailto:[email protected]>  t:  (301) 956-2319
> 
> 
> 
> 
> 
>  
> On May 25, 2017, at 10:54 AM, Steve Peery <[email protected] 
> <mailto:[email protected]>> wrote:
>  
> Hey List,
> 
> I am importing a bunch of relational data into a project and when I try to 
> save changes I get an error something like this:
> 
> Error when attempting to save data: EvaluateExpression failed: : Next 
> exception:SQL State:23000 -- error code: 1452 -- msg: Cannot add or update a 
> child row: a foreign key constraint fails (`valueA`.`valueB`, CONSTRAINT 
> `TableA_tableBID_id_FK` FOREIGN KEY (`tableBID`) REFERENCES `tableB` (`id`))
> 
> I know it is because they are not written to the database in the order 
> created. I have dealt with this in the past by doing incremental saving and 
> other awkward things, but in this case that would be a total pain.
> 
> Any suggestions for the best way to deal with this?
> 
> Thank you,
> 
> Steve Peery 
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list      ([email protected] 
> <mailto:[email protected]>)
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/webobjects-dev/aaron%40chatnbike.com 
> <https://lists.apple.com/mailman/options/webobjects-dev/aaron%40chatnbike.com>
> 
> This email sent to [email protected] <mailto:[email protected]>
>  

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to