-->
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.  [ 2 posts ] 
Author Message
 Post subject: >> NonUniqueObjectException <<
PostPosted: Thu Feb 03, 2005 2:06 pm 
Newbie

Joined: Wed Feb 02, 2005 6:30 pm
Posts: 2
EXCEPTION :

net.sf.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: com.psadirect.hibernate.CallPK@7d32cf[callId=3,subscriber=com.psadirect.hibernate.Subscriber@86506a[subscriberId=1]], of class: com.psadirect.hibernate.Call


-----------

I have a collection. I take out each item from the collection, do :

while (collection.hasNext()) {

item i = (item) collection.next();
i.setXXX(xxx);
session.update(i);
}

This fails with the above exception (NonUniqueObjectException).

Can someone tell me how to achieve what I want to do without getting this exception ?

Thanks,
SC


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 03, 2005 7:07 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
yes - dont associate different objects that represent the same entity to a single session.

_________________
Max
Don't forget to rate


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