-->
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: "detached entity passed to persist" disappears on debug
PostPosted: Tue Feb 15, 2011 3:18 pm 
Newbie

Joined: Wed Oct 06, 2010 1:35 pm
Posts: 6
I have two persisted objects related by a @OneToMany relation. When I update the child objects and attempt to persist the changes, I get a "org.hibernate.PersistentObjectException: detached entity passed to persist" error.

When I use Debug and step through the code, not only do all the objects look correct, but I don't get the error.

Anyone run into this before?


Top
 Profile  
 
 Post subject: Re: "detached entity passed to persist" disappears on debug
PostPosted: Wed Feb 16, 2011 5:31 am 
Regular
Regular

Joined: Fri Jan 28, 2011 11:44 am
Posts: 117
If your entity was "detached" then you need to merge it, not persist it!


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.