When I save an entity, I got the following exception. Does anyone know how "Found two representations of same collection " exception occurs?
My flush mode is "COMMIT". And my Hibernate session won't close until HTTP session is closed, that is I use reconnect/disconnect to manage the transaction.
Code:
Caused by: net.sf.hibernate.HibernateException: Found two representations of same collection
net.sf.hibernate.impl.SessionImpl.updateReachableCollection(SessionImpl.java:2861)
net.sf.hibernate.impl.FlushVisitor.processCollection(FlushVisitor.java:32)
net.sf.hibernate.impl.AbstractVisitor.processValue(AbstractVisitor.java:69)
net.sf.hibernate.impl.AbstractVisitor.processValues(AbstractVisitor.java:36)
net.sf.hibernate.impl.SessionImpl.flushEntity(SessionImpl.java:2581)
net.sf.hibernate.impl.SessionImpl.flushEntities(SessionImpl.java:2447)
net.sf.hibernate.impl.SessionImpl.flushEverything(SessionImpl.java:2249)
net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2228)
net.sf.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:61)
hibernate.SessionUtil.executeTxn(SessionUtil.java:167)
... 62 more