users@glassfish.java.net

Re: JPA - entityManager.flush()

From: <glassfish_at_javadesktop.org>
Date: Mon, 21 May 2007 09:55:55 PDT

Yes, the resultClass should return an entity, but when you return that entity from a business nethod that had a TransactionAttributeType.REQUIRES_NEW, you complete the transaction, and the associated persistence context, and as the result of that your entity becomes detached. (This is actually a very interesting example to use when we discuss detached entities because there is no client code involved.)

Regards,
-marina
[Message sent by forum member 'mvatkina' (mvatkina)]

http://forums.java.net/jive/thread.jspa?messageID=218156