| Author |
PersistentObjectException: detached entity passed to persist
|
jeff mutonho
Ranch Hand
Joined: Apr 30, 2003
Posts: 271
|
|
I'm trying to do a simple persisting of an object into a MySQL database , with the following code: When I run this I'm getting a org.hibernate.PersistentObjectException: detached entity passed to persist .The full stacktrace is as follows:
|
 |
srinivas bodduluri
Greenhorn
Joined: Feb 26, 2009
Posts: 1
|
|
The way you presented in the first code snippet for the lines is wrong.
you need to create UserBean object after beginning the transaction.
or what you can do is
instead of em.parsist just use merge. since user object in the above code treat it as detached object. you will have to reattach by using merge but not with parsist.
|
 |
 |
|
|
subject: PersistentObjectException: detached entity passed to persist
|
|
|