users@glassfish.java.net

Re: em.flush() doesn't work

From: <glassfish_at_javadesktop.org>
Date: Sun, 14 Jun 2009 23:58:13 PDT

I prefer to keep it in CMP because my knowledge is not ready for UserTransaction yet. Read the tutorial again and found the @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) injection can help me. Luckily my session bean doesn't call em methods itself, instead, it calls another ejb (entity facade) to issue the em methods. So with this TransactionAttribute in the entity facade, when the facade's method finish, the container will commit the changes. Although I cannot create a commit window with it, it still save me from waiting for the whole process to complete.
[Message sent by forum member 'senderj' (senderj)]

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