While working on the hibernate-demos project we had to apply the following change:
Emmanuel possible explanation:
here is my pseudo scientific proposal.
In the code, we do a persist which triggers an insert request, then we add a link to the object which triggers an update request. Could it be that somehow, when the batch operation is happening, the two operations are 1. not collapsed 2. the second update is transformed into an insert. That would explain the behavior.
Maybe that can lead you to an explanation of the bug.