1.2.2. Application-managed entity manager
An application-managed entity manager allows you to control the entity manager in application code. This entity manager is retrieved through the
EntityManagerFactory
API. An application managed entity manager can be either involved in the current JTA transaction (a JTA entity manager), or the transaction may be controlled through the EntityTransaction
API (a resource-local entity manager). The resource-local entity manager transaction maps to a direct resource transaction (i. e. in Hibernate's case a JDBC transaction). The entity manager type (JTA or resource-local) is defined at configuration time, when setting up the entity manager factory.