This content has been marked as final.
Show 3 replies
-
1. EntityManager.remove() throws java.lang.IllegalArgumentException: Removing a detached instance ?
philani Mar 30, 2011 2:45 AM (in response to aupres)try calling merge(). You entity is not being managed by EntityManager anymore.
-
2. EntityManager.remove() throws java.lang.IllegalArgumentException: Removing a detached instance ?
iabughosh Mar 30, 2011 7:45 AM (in response to philani)thats right, or you can find the entity by primary key then remove it like this :
YourEntity e = em.find(YourEntity.class, entityId);//e is the managed entity
em.remove(e);
-
3. EntityManager.remove() throws java.lang.IllegalArgumentException: Removing a detached instance ?
aupres Mar 30, 2011 9:10 PM (in response to aupres)Thanks, guys!
It works!!! ^_^