-->
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.  [ 5 posts ] 
Author Message
 Post subject: Find cause of "Found shared references to a collection&
PostPosted: Sun Jun 26, 2005 9:35 am 
Newbie

Joined: Sun Jun 26, 2005 9:30 am
Posts: 1
Hello I am trying to do some mapping with hibernate through xdoclet and with one of my clases i am getting the following exception

Found shared references to a collection
org.hibernate.HibernateException: Found shared references to a collection

Anyone has any clue of what is the most common cause for this? thanks a lot!


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 27, 2005 8:40 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Two or more of your persistent objects are refering to the same collection object. Something like
Code:
A a1 = session.load(A.class, 1);
A a2 = session.load(A.class, 2);
a1.setBs(a2.getBs());


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 25, 2005 4:52 am 
Newbie

Joined: Mon Jul 25, 2005 4:42 am
Posts: 2
Suppose I want to clone a persistent object, the same data but of course with a different primary key. This error will appear just because both objects will have the same sets, as you explained.

So which would be the best solution if I want to clone a persistent object with many-to-one relationships?

Thanks


Top
 Profile  
 
 Post subject: It solved my problem
PostPosted: Wed Apr 15, 2009 12:40 am 
Newbie

Joined: Wed Jan 10, 2007 6:38 am
Posts: 2
Thanks Michael,

you solved my problem. :)


Top
 Profile  
 
 Post subject: Re: Find cause of "Found shared references to a collection&
PostPosted: Tue Dec 14, 2010 4:28 am 
Newbie

Joined: Tue Dec 14, 2010 4:21 am
Posts: 3
I have getting "Found shared references to a collection" Same error is their any problem if i have written " hibernate.cache usage="read-only" include="all"" for that particular bean.
And this error got first time ever. So What will be problem .And What is solution to solve this?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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.