I had the same problem. In my case, the issue was that someone used BeanUtils to copy the properties of one entity to another, so we ended up having two entities referencing the same collection.
Given that I spent some time investigating this issue, I would recommend the following checklist:
Look for scenarios like entity1.setCollection(entity2.getCollection())
and getCollection
returns the internal reference to the collection (if getCollection() returns a new instance of the collection, then you don't need to worry).
Look if clone()
has been implemented correctly.
Look for BeanUtils.copyProperties(entity1, entity2)
.