-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Found shared reference error
PostPosted: Fri Jul 16, 2004 10:57 am 
Beginner
Beginner

Joined: Wed Jul 14, 2004 11:51 am
Posts: 43
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


Top
 Profile  
 
 Post subject: Found shared reference error
PostPosted: Tue Aug 24, 2004 11:59 pm 
Newbie

Joined: Tue Aug 24, 2004 11:42 pm
Posts: 1
I just started getting this message today. We are running some multi-threaded test in our hibernate evaluation. This only happens when I run the sames tests (some retrieves) with 2 or more threads.

Don't know if the cause is the same, however this is the only post I founf with the same error message.

Can someone decode this error message for us?

thanks...

James


Top
 Profile  
 
 Post subject: similar exception....
PostPosted: Tue Dec 27, 2005 4:17 am 
Newbie

Joined: Tue Dec 27, 2005 4:06 am
Posts: 1
I encounted the same issue....

env.
Hibernate 2.1.7 (spring1.1, but I donot think it is because of spring)


The entities relationship is :

A is the parent of B1, B2 ,B3 ,B4 .
Also there is another relation(AB4) between A and B4 . So the HBM looks like

<class a>
.....

<set>
<... AB4 ... >
</set>

<joined-subclass B1 />
<joined-subclass B2 />
<joined-subclass B3 />
<joined-subclass B4 />


</class a>

Now The exception is frequent, BUT is not inevitable....

When I removed the set declaration. it is fine......


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.