Re: Delete on cascade question
Re: Delete on cascade question
- Subject: Re: Delete on cascade question
- From: Chuck Hill <email@hidden>
- Date: Mon, 27 Nov 2006 10:15:42 -0800
Hi Miguel,
On Nov 27, 2006, at 9:40 AM, Miguel Arroz wrote:
I have a complicated graph of objects I want to delete. Basically
almost all of them deletes the next ones on cascade. So, imagine A.
A has a lot of Bs. Each B has a lot of Cs. Each C has a lot of Ds,
and so on. On a moderate size example, I'm talking about 5000
objects or more.
Even if I choose the delete on cascade option in EOModeler, the
generated SQL will not have the DELETE CASCADE code, so I guess
it's all done by WO.
Yes. It has to fetch each object it deletes so that it can call
validateForDelete on it. It does this to maintain the consistency as
set in your model and code.
And that means... it's terribly slow.
Yes, it can be.
So here's my two questions:
1) Is there a way to make EOModeler generate the DELETE CASCADE SQL?
No. That would violate EOF's goal of maintaining consistency and
enforcing rules.
2) Adding it to the database definition (either EOModeler or
manually) will conflict with EO in any way?
It may. If the objects being deleted have been fetched, then EOF
will not be aware that they are gone. This is the same situation
that you would face if you were running multiple instances and EOF
processed the deletion. It is a situation that you need to handle
anyway.
So what it comes down to is do you need speed or validateForDelete more?
Chuck
--
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