if (!testBeginSetrollbackonlyCommit())
return false;
// Create first instance
try {
bean1 = home.create(new AccountPK("UT_TestBean1"), "Ole1");
} catch (Exception ex) {
log.debug("failed", ex);
return false;
}
// Single resource tests
if (!testSingleRollback())
return false;
if (!testSingleCommit())
return false;
if (!testSingleSetrollbackonlyCommit())
return false;
// Can second instance be created in a tx that is rolled back?
try {
ut.begin();
bean2 = home.create(new AccountPK("UT_TestBean2"), "Ole2");
ut.rollback();
// Should no longer exist
boolean gotException = false;
try {
bean2.setPersonsName("Ole");
} catch (Exception e) {
log.info("IGNORE PREVIOUS NoSuchEntityException - it is intentional");
gotException = true;
}
if (!gotException)
throw new RuntimeException("Rollback didn't rollback create.");
} catch (Exception ex) {
log.debug("failed", ex);
return false;
}
// Create second instance
try {
bean2 = home.create(new AccountPK("UT_TestBean2"), "Ole2");
} catch (Exception ex) {
log.debug("failed", ex);
return false;
}