Re: Cascading Deletes in WO and DB
Re: Cascading Deletes in WO and DB
- Subject: Re: Cascading Deletes in WO and DB
- From: David Avendasora <email@hidden>
- Date: Fri, 8 Jun 2007 11:45:54 -0500
Ken and Chuck,
Thanks for the input. I have the delete rules set in the DB out of
habit. I usually make changes to the DB first, then to WO (as opposed
to generating SQL out of EOModeler) and it helps remind me to setup
the EOModel correctly. It had just occurred to me that it may cause
conflicts, but I suppose if the SQL executed for the delete simply
returns "0 record(s) affected" WO will simply look at that as "Not an
error" and continue on.
But I can see a HUGE danger if the EOModel and DB are NOT in perfect
agreement on the cascading deletes as things could get deleted in the
DB without WO knowing which I'm sure could cause all sorts of crazy,
difficult to diagnose problems.
Dave
On Jun 8, 2007, at 11:28 AM, Ken Anderson wrote:
David,
Is there a reason you have them in your DB? It's far safer to
implement the cascade deletes in WO so you don't have to worry
about your object graph and the database getting out of sync.
To answer your question, the DB or WO will win at different times
because of the order of operations generated from WO. I don't
think it will be a problem though, since I don't believe WO cares
if the number of deleted rows fails to match the number of deleted
objects.
Ken
On Jun 8, 2007, at 11:57 AM, David Avendasora wrote:
Hi all,
I have a question regarding the best place to handle cascading
deletions. Right now both my database (MS SQLServer) and my
EOModel have cascading deletes defined on several relationships.
The EOModel and database mirror each other's cascade settings.
Is this going to confuse WO if it goes to delete a related object
only to find that the DB has already deleted it (I'm assuming that
the database will have deleted the related record before WO gets
around to it)?
Thanks,
Dave
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40anderhome.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:
This email sent to email@hidden