PhysicalEntityManagerWrapper extendedEmAssociatedWithTx = EntityManagerWrapper.getExtendedEntityManager(j2eeTx, emf);
// If there's not already an EntityManager registered for
// this extended EntityManagerFactory within the current tx
if (extendedEmAssociatedWithTx == null) {
j2eeTx.addExtendedEntityManagerMapping(emf, extendedEm);
sessionCtx.setEmfRegisteredWithTx(emf, true);
// Tell persistence provider to associate the extended
// entity manager with the transaction.
if(extendedEm.getSynchronizationType() == SYNCHRONIZED) {