How do you handle CMR with non-nullable fields and not using cascade-delete?
I have three beans A, B and C. A is 1:1 with B and 1:many with C. The foreign key in A that represents B is non-nullable (obviously, no fields exists in A that represents C). Now I create a record in A and C, then delete A (the record in C points to the record in A). For the A-C relationship, I use batch-cascade-delete. So from the logs, it says "Scheduled for batch-cascade-delete". So there is no problem there. For the A-B relationship, the container is setting the relevent field to NULL - this causes a foreign key violation error. Is there any way to handle this generally? Can I postpone the NULL setting action (preferably never to be done, as the entity is about to disappear)? Or do I have to abandon CMR (I cannot change the database - besides, it makes no sense to)? Thanks, Ian View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3867203#3867203 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3867203 ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user