-
1. Re: JBoss-3.2.1 CMR cascade-delete order
samart Jul 9, 2003 7:06 PM (in response to studenik)i've got the same exact issue...
anyone know why?
Thanks. -
2. Re: JBoss-3.2.1 CMR cascade-delete order
studenik Jul 10, 2003 11:01 AM (in response to studenik)I am looking for any possibility to specify the order of cascade-delete. Is it possible to tell the container to delete child records first and then delete the parent target? I do not ask for the solution. I just ask is it possible or not.
Thanks and cheers! -
3. Re: JBoss-3.2.1 CMR cascade-delete order
samart Jul 10, 2003 12:34 PM (in response to studenik)if you turn on the CMP debug output, you can see what Jboss does.
it first nulls all the FK's. then deletes the tables...so if they do that, then delete order doesnt matter. The problem is, as i discovered, if the child table has the FK as a PK. clearly you cant null the PK...and then the cascade delete bombs. my workaround : i'm removing the FK consraint on my pk, and adding another non pk column as the fk, so it can be nulled. messy, but it does roll back should things go awry.
its kinda counter intuitive that they null all the child FK's, cuz thats a bunch of updates, and then deletes...when if it just deleted in the right order to being with, there would be no issue, and less db activity. i guess the question is, how can the container discern the table dependencies? maybe thats why they null the fk's, then delete in any order..maybe it cant determine the delete order..
i agree with you, that it would be nice to specify the delete order..even nicer if it just figured it out for you. -
4. Re: JBoss-3.2.1 CMR cascade-delete order
studenik Jul 10, 2003 2:13 PM (in response to studenik)Hi samart,
Thank you for your comments. For now, I will be deleting children from application until a container based feature is discovered/developed. I am glad I was not alone in looking for this feature.
Cheers!