@Test public void testAcquireTwiceInSameTx() throws Exception { EntityManager em; em = persistenceProvider.acquireEntityManager(); em.persist(new DummyEntity("1")); em.flush(); em.clear(); em.close(); em = persistenceProvider.acquireEntityManager(); em.persist(new DummyEntity("2")); em.flush(); em.clear(); em.close(); }
public EntityManager acquireEntityManager() { return doAcquireEntityManager(); }
PersistenceProvider { public EntityManager acquireEntityManager() { return doAcquireEntityManager(); } }
PersistenceProvider { public EntityManager acquireEntityManager() { return doAcquireEntityManager(); } PersistenceProvider(EntityManagerFactoryProvider emfProvider); }
PersistenceProvider { public EntityManager acquireEntityManager() { return doAcquireEntityManager(); } PersistenceProvider(EntityManagerFactoryProvider emfProvider); void openPersistenceUnit(); void closePersistenceUnit(); EntityManager acquireEntityManager(); EntityManager acquireEntityManagerWithActiveTransaction(); void releaseEntityManagerWithRollback(EntityManager em); T run(Boolean needActiveSession, RunCallback<T> callback); void run(Boolean needActiveSession, RunVoid callback); }
PersistenceProvider { public EntityManager acquireEntityManager() { return doAcquireEntityManager(); } PersistenceProvider(EntityManagerFactoryProvider emfProvider); void openPersistenceUnit(); void closePersistenceUnit(); EntityManager acquireEntityManager(); EntityManager acquireEntityManagerWithActiveTransaction(); void releaseEntityManagerWithRollback(EntityManager em); T run(Boolean needActiveSession, RunCallback<T> callback); void run(Boolean needActiveSession, RunVoid callback);  }