Hello,
I am trying to use inheritance with the joined-subclass mapping. Unfortunately, I am getting the following error when trying to create a child:
Code:
net.sf.hibernate.HibernateException: Found shared references to a collection at com.agencebraque.itineraryserver.PNR.passenger.facades.PassengerInfoPersistenceFacadeBase.savePassengerInfo(PassengerInfoPersistenceFacadeBase.java:63) at com.agencebraque.itineraryserver.PNR.passenger.tests.AbstractPassengerInfoTestCase.createMaximalPassengerInfo(AbstractPassengerInfoTestCase.java:35) at com.agencebraque.itineraryserver.PNR.passenger.tests.PassengerInfoTestCase.testCreateMaximal(PassengerInfoTestCase.java:20) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)Caused by: net.sf.hibernate.HibernateException: Found shared references to a collection at net.sf.hibernate.impl.SessionImpl.updateReachableCollection(SessionImpl.java:2866) at net.sf.hibernate.impl.FlushVisitor.processCollection(FlushVisitor.java:32) at net.sf.hibernate.impl.AbstractVisitor.processValue(AbstractVisitor.java:69) at net.sf.hibernate.impl.AbstractVisitor.processValues(AbstractVisitor.java:36) at net.sf.hibernate.impl.SessionImpl.flushEntity(SessionImpl.java:2581) at net.sf.hibernate.impl.SessionImpl.flushEntities(SessionImpl.java:2447) at net.sf.hibernate.impl.SessionImpl.flushEverything(SessionImpl.java:2249) at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2228) at net.sf.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:61) at com.agencebraque.itineraryserver.PNR.passenger.facades.PassengerInfoPersistenceFacadeBase.savePassengerInfo(PassengerInfoPersistenceFacadeBase.java:60) ... 16 more
I have seen a post on this site of the same topic in january but didn't see any replies. Has anybody gotten the inheritance to work with either subclass or joined-subclass mappings. If so could you please send me an example of your POJO entity and the mapping you are using.
Otherwise, does anybody know how or why this exception occurs. I can't figure it out but everything else works so I assume it is an inheritance problem.
Thanks a lot,
Francois