-
1. Re: Auto flush does not work in container managed transaction
smarlow Feb 21, 2012 9:32 PM (in response to adrianosch)Try changing the
joinTransaction method to invoke the
entityManager, it should get enlisted into the JTA transaction at (EntityManager) invocation time.
I need to investigate this further before coming up with a real answer.
Scott
-
2. Re: Auto flush does not work in container managed transaction
adrianosch Feb 22, 2012 7:00 AM (in response to smarlow)You are right Scott, if a use any entity manager method the flush is performed.
But this isn’t the correct behavior, is it?
-
3. Re: Auto flush does not work in container managed transaction
smarlow Feb 22, 2012 9:17 AM (in response to adrianosch)1 of 1 people found this helpfulYes, you are right.
7.9.1 Container Responsibilities:
...
For stateful session beans with extended persistence contexts:
...
When a business method of the stateful session bean is invoked, if the stateful session bean uses container managed transaction demarcation, and the entity manager is not already associated with the current JTA transaction, the container associates the entity manager with the current JTA transaction and calls EntityManager.joinTransaction.
I created AS7-3870 for this. Thanks for reporting it!
Scott
-
4. Re: Auto flush does not work in container managed transaction
adrianosch Feb 22, 2012 10:39 AM (in response to smarlow)Thank you.
-
5. Re: Auto flush does not work in container managed transaction
smarlow Feb 24, 2012 3:56 PM (in response to adrianosch)The fix is merged and will be in AS 7.1.1. The fix should also show up in the nightly build tomorrow.