Community
Participate
Working Groups
There are some cases where it is impossible to determine a commit order that will allow Cascade Remove to work with just DELETE statements. A simple example: A has a 1-1 called rel1 to B with foreign key bfk1 on A B has a 1-1 called rel2 to A with foreign key afk2 on B In this case, even if there is no instance-level cycle it is impossible to do a delete with just DELETE statements. An UPDATE needs to be issued to fix the keys to avoid constraint violdation. i.e. if my instance model has a1 holding a b1 in rel1 but rel2 is empty, a1 must be deleted first. if b1 has a1 in rel2, but rel1 is empty, b1 must be deleted first To make this work, we need a strategy that will work for the general case. So that one part of that bidirectional relationship will have an update executed on it to null out the FK prior to the delete. See bug Bug 315141 - which handles the instance-level cycle issue - that bug will also have to be address with this bug.
*** This bug has been marked as a duplicate of bug 328040 ***
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink