persistence.xml different transaction-type attributes
Defaults Default to JTA in a JavaEE environment and to RESOURCE_LOCAL in a JavaSE environment. RESOURCE_LOCAL With <persistence-unit transaction-type=”RESOURCE_LOCAL”> you are responsible for EntityManager (PersistenceContext/Cache) creating and tracking You must use the EntityManagerFactory to get an EntityManager The resulting EntityManager instance is a PersistenceContext/Cache An EntityManagerFactory can be injected via the @PersistenceUnit annotation only (not … Read more