Hi. All container-managed entity managers are JTA managers. An application-managed entity manager may be either JTA or resource-local, and they are always extended. The difference is that when it is JTA, it simply is used in a distributed transaction with
EJB calls, Timer creations, other resource managers and so on. When the UserTransaction (either container-managed or bean-managed, it doesn't really matter) is rolled back, all of the mentioned operations are rolled back. If you used resource-local manager (EntityTransaction interface to demarcate transactions), the rollback on the UserTransaction would not influence the entity manager operations. Hence, you will most likely use JTA in
Java EE, whereas resource-local are designed to be usable in Java SE, when there is possibly no JTA implementation available.
One more note - when you use an application-managed JTA entity manager and create them outside an active JTA transaction (for example, when you inject a manager factory and in @PostConstruct you create the entity manager), you call joinTransaction() before you call refresh(), persist(), merge() or remove(), so that these operations don't throw TransactionRequiredException. The JTA transaction may either be container- or bean-managed.
Does this make sense?
Raf