Użytkownik Vineet Deodhar napisał:
> Before asking this query, I have gone through 3 similar links in archive
> as under.
> ------------------------
> http://news.gmane.org/find-root.php?message_id=%3c054.fe70fb1da2b15c6056833296f57e0261%40ulmcnett.com%3e
> ------------------------
> msg#00244
> ------------------------
> Ticket #1012 (closed defect: wontfix)
> ------------------------
> DB is MySQL.
> Chain of Parent:Child:Grandchild:.. is deep
> In MySQL child tables, referential integrity is 'RESTRICT'.
> So the DB will give error while deleting a parent record, if child
> record(s) exist(s).
>
> My idea is to do something like this:
> * Make use of "beforeDelete()"
> * In that, iterate through childs, grandchilds, etc.
> * Use delete() for each bizobj.
> (should I use deleteAllChildren() here?)
>
> bizobj's "REFINTEG" should be what in this case?
> "CASCADE" or "IGNORE"
>
> Pl. suggest if there is any fine-tuning or correction required in my
> approach.


Hi.

Personally, I prefer to use backend based integrity rules.
Most important advantage is, it's much faster than framework based.
If you do so, use REFINTEG_IGNORE.
But if you intend to use framework one, you should use REFINTEG_CASCADE.
You don't need additional steps with beforeDelete() method, since framework
handle all references himself.
-- 
Regards
Jacek Kałucki
_______________________________________________
Post Messages to: Dabo-users@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/4e995010.1000...@rz.onet.pl

Reply via email to