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