utControl.setReturnValue(Status.STATUS_ACTIVE, 1);
ut.rollback();
utControl.setVoidCallable(1);
utControl.replay();
JtaTransactionManager ptm = newJtaTransactionManager(ut);
assertFalse(TransactionSynchronizationManager.isSynchronizationActive());
TransactionStatus status = ptm.getTransaction(new DefaultTransactionDefinition());
assertTrue(TransactionSynchronizationManager.isSynchronizationActive());
// first rollback
ptm.rollback(status);
assertFalse(TransactionSynchronizationManager.isSynchronizationActive());
try {
// second rollback attempt
ptm.rollback(status);
fail("Should have thrown IllegalTransactionStateException");
}
catch (IllegalTransactionStateException ex) {
// expected
}