Hi
I have a transaction in which all sub entries of a parent element should be deleted on a MySQL DB. Afterwards the parent element itself should be deleted.
The transaction fails due to a coinstraint violation during the deletion of the parent element, due to the fact that not all children were deleted.
The routine registers 1585 entries for deletion. 1584 sub elements and the parent element, which is correct.
The log for the first step says: 15:00:57.452 DEBUG o.h.e.d.AbstractFlushingEventListener - Flushed: 0 insertions, 0 updates, 1584 deletions to 1585 objects 15:00:57.452 DEBUG o.h.e.d.AbstractFlushingEventListener - Flushed: 0 insertions, 0 updates, 1584 deletions to 1585 objects 15:00:57.452 DEBUG o.h.e.d.AbstractFlushingEventListener - Flushed: 0 (re)creations, 0 updates, 1 removals to 1 collections 15:00:57.452 DEBUG o.h.e.d.AbstractFlushingEventListener - Flushed: 0 (re)creations, 0 updates, 1 removals to 1 collections
Now taking a look at the delete statements, only 1583 (105x 15[Batch Size] plus 1x 8) calls are made.
In the second step, where I delete the parent element I run into the constraint violation.
For some reason, this only happens in this specific case. If I create another parent with a random amount of sub elements, everything works as expected.
Due to the fact that I'm pretty desperate because I ran out of ideas what could be the reason. I would appreciate your help a lot!
|