John Schneider commented on Enhancement PLINK-332

Using Glassfish, I've ensured there's an active transaction in the @PostConstruct method invoked in the EJB startup bean, using several different strategies. It seams that org.picketlink.idm.jpa.internal.mappers.EntityMapper is not using the active transaction, probably because it's not an EJB.

I wonder if org.picketlink.idm.jpa.internal.mappers.EntityMapper.persist were modified to get a transaction reference from the entityManager and start a transaction, if it might work correctly in all environments. Maybe something like:
EntityTransaction tx = null;
try {
tx = entityManager.getTransaction();
if (tx != null)

{ tx.begin(); entityManager.persist(entity); tx.commit(); }

} catch (Exception e) {
if ( tx != null && tx.isActive() ) tx.rollback();
throw e;
}

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira