I have a situation where I delete an Entity that contains a Set<OtherEntity> with delete-orphan cascade on the relationship. If there are one or two OtherEntity objects in the set, they are deleted properly. But if there are three or four in the set, one or two of them doesn't get deleted. Basically, a max of two OtherEntity objects seems to be deleted. I end up with orphans in my database. I haven't tried with more than 4 elements since the business logic only allows up to 4 in the set.
There are no other references to these OtherEntity instances, so I'm not sure why the cascading delete doesn't complete properly. I'm using basically the same code on many other relationships in my app, and they all work correctly. Just this one relationship is having problems.
I know there is probably some mistake on my end, but I'm not sure how to best debug it. I'm looking for suggestions on where to start. For instance, is there a particular hibernate package that I should focus on? Something specific to delete-orphan? I'd like to add trace or debug to log4j output on whatever package that might be.
Thanks, Tauren
|