@Override protected EntityManager getEntityManager() { EntityManager entityManager; boolean isInTx; isInTx = TransactionUtil.isInTx(transactionManager); if (isInTx) { entityManager = getOrCreateTransactionScopedEntityManager(emf, puScopedName, properties, synchronizationType); } else { entityManager = NonTxEmCloser.get(puScopedName); if (entityManager == null) { entityManager = createEntityManager(emf, properties, synchronizationType); NonTxEmCloser.add(puScopedName, entityManager); } } return entityManager; }
@Override protected EntityManager getEntityManager() { EntityManager entityManager; boolean isInTx; isInTx = TransactionUtil.isInTx(transactionManager); if (isInTx) { entityManager = getOrCreateTransactionScopedEntityManager(emf, puScopedName, properties, synchronizationType); } else { entityManager = NonTxEmCloser.get(puScopedName); if (entityManager == null) { entityManager = createEntityManager(emf, properties, synchronizationType); NonTxEmCloser.add(puScopedName, entityManager); } } return entityManager; }