}
for (final Map.Entry<EntityManagerFactory, EntityManagerTracker> entry : entityManagers.entrySet()) {
final EntityManagerFactory entityManagerFactory = entry.getKey();
final EntityManager entityManager = entry.getValue().getEntityManager();
entityManager.joinTransaction();
final EntityManagerTxKey txKey = new EntityManagerTxKey(entityManagerFactory);
transactionRegistry.putResource(txKey, entityManager);
}
}
}