[jboss-user] [EJB 3.0] - Re: EntityManager not auto-flushing at end of SLSB method
mazz@jboss.com
do-not-reply at jboss.com
Wed Jan 2 22:59:17 EST 2008
Check your transaction demarcation. Just because you exit a method does NOT automatically mean your entity manager flushes the data to the DB.
If you exit a method that also exits out of your transaction, THEN it will flush. But if you exit a method that was called with an already started transaction (e.g. tx type== SUPPORTS or an intra-bean call) then it won't necessarily do anything.
For example, if you call A.method1 which calls A.method2, exiting A.method2 probably won't do anything special (it could, if you want - see REQUIRES_NEW semantics). Exiting A.method1 won't do anything special either, unless the transaction boundary stops at A.method1 (@TransactionType is REQUIRES for example and it was called outside of any tx)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4116593#4116593
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4116593
More information about the jboss-user
mailing list