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.  [ 1 post ] 
Author Message
 Post subject: getting org.hibernate.NonUniqueObjectException
PostPosted: Wed Dec 10, 2008 8:32 am 
Newbie

Joined: Wed Dec 10, 2008 8:19 am
Posts: 1
I am having 2 tables A and B, where B is the child of A, also there is relation ship between B and B

Scenario:
a is the record in A
b1,b2 are the records in B

b1 and b2 are children of a,
also b2 is children of b1.

I have coded such that,
if A is updated -> its child B has to be updated ->child B of B has to be updated



when I try to update a, it updates b1 first, and since b2 is child of b1, b2 will get updated.

in next iteration, b2 will be getting updated since b2 is the child a, at this point of time I am getting "org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session" this error, since b2 already got loaded into session when b1 is updated, but when a tries to update b2, i m getting this error.

Please help me how can I solve this issue... plese let me know if you need more information.

Thanks in advance


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

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.