In the demo of Enthuware Mock for SCBCD5, I found this:
"Session beans that use container managed EntityManager cannot use bean managed transactions."
For me it's true but Enthuware says in its explanation: "Transaction management type of a session bean and type of entity manager (container managed or bean managed) are two different things. Any type of entity manager can be enlisted in a transaction started by a session bean with bean managed transactions."
So... Can a Container Managed EntityManager be used with BMT Session Bean? If yes, when does it join the UserTransaction ?
Thanks in advance.
SCJP5 | SCBCD5 | SCEA5 Part 1
Benoît de Chateauvieux
Joined: Aug 10, 2007
Finally, I think that the Container Managed Entity Manager never joins the UserTransaction.
The specs (5.6.1) says: "If the entity manager is invoked outside the scope of a transaction, any entities loaded from the database will immediately become detached at the end of the method call."