In my current project our team got the following HibernateException "Found two representations of same collection". Could anybody clear me the cause of this exception?
I see the comment to the method that throws this exception:
Code:
/**
* Initialize the role of the collection.
*
* The CollectionEntry.reached stuff is just to detect any silly users who set up
* circular or shared references between/to collections.
*/
void updateReachableCollection(PersistentCollection coll, Type type, Object owner) throws HibernateException {
CollectionEntry ce = getCollectionEntry(coll);
if (ce==null) {
// refer to comment in addCollection()
throw new HibernateException("Found two representations of same collection");
}
...
}
Does it mean that an object has two collections with the same JVM idenity or only two equal collections?
Before refactoring everything was fine :). Now going to dig hiberante sources and look what is wrong with our model/logic, but any explanation could help a lot.
Thanks,
one of the silly users (Leonid:)