users@glassfish.java.net

Re: GF V3 Embedded Container: Problem with JPA, Entity is not managed

From: Marina Vatkina <Marina.Vatkina_at_Sun.COM>
Date: Thu, 11 Feb 2010 11:48:39 -0800

merge() needs to be done inside the remove() method of the EJB.

-marina

glassfish_at_javadesktop.org wrote:
> Thank you Marina for reply.
>
> I've thougt that the find method returns always an attached entity, but maybe I'm wrong here. When I'm adding following line in the testcase before the remove command:
>
> holiday = holidayEJB.getEm().merge(holiday);
>
> then a transaction exception occurs:
>
> javax.persistence.TransactionRequiredException
>
> But: The transactions are container managed, so i do not want to run a manual transaction.
>
> So, what's wrong?
> [Message sent by forum member 'pepatpx' (prope_at_t-online.de)]
>
> http://forums.java.net/jive/thread.jspa?messageID=386052
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>