[
https://issues.jboss.org/browse/ARQ-723?page=com.atlassian.jira.plugin.sy...
]
Juergen Zimmermann commented on ARQ-723:
----------------------------------------
Bartosz, sorry, but I'm to busy to set up a GIT environment just for adding a few
lines to Arquillian Persistence.
TransactionalWrapper.afterTest() ignores
SessionContext.setRollbackOnly()
-------------------------------------------------------------------------
Key: ARQ-723
URL:
https://issues.jboss.org/browse/ARQ-723
Project: Arquillian
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: Extension - Persistence
Affects Versions: persistence_1.0.0.Alpha3
Reporter: Juergen Zimmermann
Assignee: Bartosz Majsak
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())) {
trans.rollback();
}
else {
trans.commit();
}
}
else {
trans.rollback();
}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see:
http://www.atlassian.com/software/jira