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: merge gives PersistenceException
PostPosted: Thu Oct 28, 2010 5:11 am 
Newbie

Joined: Fri Jun 04, 2010 8:57 pm
Posts: 19
I am trying to merge an entity named Donor. The merge throws "org.hibernate.PersistentObjectException: detached entity passed to persist: Donor". Here is the sequence of steps that I am following

1. Read the Donor Entity using em.find(). Transaction is terminated and Donor is detached.
2. Update the detached Donor Entity including any relationships. Some relationships require other entities that are not available at this time.
3. Begin transaction. Update the detached Donor entity for relationships that were left out in step 2 above. Then merge the Donor entity. The em.merge(Donor) throws the above said PersistenceException.

I am unsure as to why the merge operation is trying to persist the Donor entity instead of merging.

regards,
Nirvan.


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.