[jboss-user] [JBoss Seam] - Re: FlushMode=MANUAL -- not immediately commited to db?
msystems
do-not-reply at jboss.com
Thu Feb 7 14:20:31 EST 2008
anonymous wrote :
| I am using EJB3/JPA persistence and am having trouble with a manually flushed transaction. Even after a call to em.flush(), the data is not visible to an external db client -- it seems that even though manually flushed, the transaction is not committed until after the outer backing bean action method returns.
|
The transaction is commited in the after 'invoke application' phase (by the SeamPhaselistener) - if you're using a Seam-managed transaction (looks like you are using it).
anonymous wrote :
| I've tried to call em.getTransaction().commit(), but get a runtime error:
|
| | Caused by: javax.faces.el.EvaluationException: java.lang.IllegalStateException: A JTA EntityManager
| | cannot use getTransaction()
| |
|
The exception is thrown because you're using a Container-managed transaction (CMT) bean.
anonymous wrote :
| Is it possible to commit the transaction without returning from an action method?
|
To my knowledge, no !
You need to use a bean-managed transaction (BMT) bean if you want to control the transaction - i.e. tx.begin() tx.commit() etc.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4127547#4127547
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4127547
More information about the jboss-user
mailing list