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.
You are right Scott, if a use any entity manager method the flush is performed.
But this isn’t the correct behavior, is it?
1 of 1 people found this helpful
Yes, 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!