-
Bug
-
Resolution: Done
-
Major
-
persistence_1.0.0.Alpha3
-
None
If a method is being tested that invokes SessionContext.setRollbackOnly(), then the commit mode doesn't work correctly, because doing a commit() after setRollbackOnly() will fail. Therefore, the method TransactionalWrapper.afterTest() should be implemented as follows:
final TransactionMode mode = metadataProvider.get().getTransactionalMode();
final UserTransaction trans = obtainTransaction();
if (TransactionMode.COMMIT.equals(mode)) {
if (Status.STATUS_MARKED_ROLLBACK.equals(trans.getStatus()))
else
{ trans.commit(); } }
else