[jboss-user] [EJB 3.0] - Re: Detached Entity passed to persist

2009-01-14 Thread jaikiran
When you return the entity back to the client from the bean, it becomes detached from the entitymanager. When you are passing the entity back to the bean, the second time, you have the option to call the mergedEntity = entityManager.merge(entity); to re-attach the detached entity. View the

[jboss-user] [EJB 3.0] - Re: detached entity passed to persist

2008-11-29 Thread PeterJ
This means that you entity is not being managed by the entity manager. Try merging it back in with EntityManager.merge() before persisting the changes. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4193191#4193191 Reply to the post :

[jboss-user] [EJB 3.0] - Re: detached entity passed to persist

2007-06-24 Thread icordoba
I see this is an old thread but just in case someone nees a solution... try to enclose everyting in a UserTransaction. If you take an EJB3 entity outside the transaction, you cannot re-persist it or iterate over CMRs, etc. You need then a UserTransaction in the client side. View the original

[jboss-user] [EJB 3.0] - Re: detached entity passed to persist

2007-04-25 Thread fhh
Can you try with id set to null? I have a feeling the the entity manager might think that your object has already been persisted because it already has an id. Regards Felix View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4040467#4040467 Reply to the post :

[jboss-user] [EJB 3.0] - Re: detached entity passed to persist

2007-04-24 Thread fhh
Let me guess: An object with the id 0 does already exist since you ran your code at least once before. Regards Felix View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4040362#4040362 Reply to the post :

[jboss-user] [EJB 3.0] - Re: detached entity passed to persist

2007-04-24 Thread graflaszlo
Hi Felix, No, the table is empty, I try to insert the first record. I tried with id = 1, but with the same result. Any idea? View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4040429#4040429 Reply to the post :

[jboss-user] [EJB 3.0] - Re: Detached entity passed to persist

2006-09-22 Thread jactor
Please help me this so I can avoid the big head ache... After a variety of debugging, this is the case: | ... | B b = a.getB(); | long id = saveOrUpdate(b); // Autoboxing. Originally an instance of Long | entityManager.flush(); | b.setId(id);