[arquillian-issues] [JBoss JIRA] (ARQ-723) TransactionalWrapper.afterTest() ignores SessionContext.setRollbackOnly()
Bartosz Majsak (Commented) (JIRA)
jira-events at lists.jboss.org
Tue Jan 10 03:30:09 EST 2012
[ https://issues.jboss.org/browse/ARQ-723?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12654809#comment-12654809 ]
Bartosz Majsak commented on ARQ-723:
------------------------------------
Sure, with pleasure :)
There are only few things needed to move on:
* Sign [Contributor License Agreement|https://cla.jboss.org] for Arquillian project.
* Create [GitHub|https://github.com/] account (if you don't have one already).
* [Fork repository|http://help.github.com/fork-a-repo/] of [Arquillian Persistence Extension|https://github.com/arquillian/arquillian-extension-persistence].
* Create branch for issue which you would like to work on.
* Assign yourself to this Jira issue and start hacking :)
Once you are done just create a [pull request|http://help.github.com/send-pull-requests/] and I will take care of pushing it upstream.
There is also handy [Git guideline|http://community.jboss.org/wiki/ShrinkWrapDevelopmentAndContribution] from Shrinkwrap project which describes a workflow used by Arquillian as well.
If you have any questions just drop me a line! I will be more than happy to help.
> 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
More information about the arquillian-issues
mailing list