use of org.drools.persistence.jta.JtaTransactionManager in project drools by kiegroup.
the class JpaBasedPersistenceTest method setUp.
@Before
public void setUp() throws Exception {
context = DroolsPersistenceUtil.setupWithPoolingDataSource(DROOLS_PERSISTENCE_UNIT_NAME);
emf = (EntityManagerFactory) context.get(ENTITY_MANAGER_FACTORY);
if (useTransactions()) {
useTransactions = true;
Environment env = createEnvironment(context);
Object tm = env.get(EnvironmentName.TRANSACTION_MANAGER);
this.txm = new JtaTransactionManager(env.get(EnvironmentName.TRANSACTION), env.get(EnvironmentName.TRANSACTION_SYNCHRONIZATION_REGISTRY), tm);
}
}
Aggregations