if (Boolean.getBoolean("org.apache.ode.test.persistent")) {
emf = Persistence.createEntityManagerFactory("ode-unit-test-embedded");
em = emf.createEntityManager();
_cf = new org.apache.ode.daohib.bpel.BpelDAOConnectionFactoryImpl();
_server.setDaoConnectionFactory(_cf);
scheduler = new MockScheduler() {
@Override
public void beginTransaction() {
super.beginTransaction();
em.getTransaction().begin();
}
@Override
public void commitTransaction() {
super.commitTransaction();
em.getTransaction().commit();
}
@Override
public void rollbackTransaction() {
super.rollbackTransaction();
em.getTransaction().rollback();
}
};
} else {
scheduler = new MockScheduler();
_cf = new BpelDAOConnectionFactoryImpl(scheduler);
_server.setDaoConnectionFactory(_cf);
}
_server.setInMemDaoConnectionFactory(new BpelDAOConnectionFactoryImpl(scheduler));
_server.setScheduler(scheduler);