[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-7215) NullPointerException in JtaTransaction when trying mark transaction for rollback
Adi Sesha Reddy (JIRA)
noreply at atlassian.com
Tue Apr 24 17:51:48 EDT 2012
[ https://hibernate.onjira.com/browse/HHH-7215?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46411#comment-46411 ]
Adi Sesha Reddy commented on HHH-7215:
--------------------------------------
Steve,
I added another test case.Apart from exception scenario we did not see any problems with using JTATransactionFactory.
Using CMTTransactionFactory solved my issue for now but I need to see if there are any side effects because we are using Spring's transaction template which leverages UserTransaction.
Now I am confused, from documentation on CMT(http://docs.jboss.org/hibernate/orm/4.1/devguide/en-US/html_single/#d5e576),
'CMT-based transaction management leverages the javax.transaction.UserTransaction interface as obtained from org.hibernate.service.jta.platform.spi.JtaPlatform API'
>From code and comments of CMTTransaction, 'Additionally, this strategy does *not* attempt to access or use the {@link javax.transaction.UserTransaction}'. This is quite opposite of the documentation.
If you can explain this, that will be great.
Thanks for helping with this issue. I closed the pull request.
> NullPointerException in JtaTransaction when trying mark transaction for rollback
> --------------------------------------------------------------------------------
>
> Key: HHH-7215
> URL: https://hibernate.onjira.com/browse/HHH-7215
> Project: Hibernate ORM
> Issue Type: Bug
> Components: core
> Affects Versions: 4.0.1, 4.1.0, 4.1.1
> Reporter: Adi Sesha Reddy
> Labels: transaction
> Attachments: BasicDrivingTest.java, UnqiueConstraintVoilationJtaTest.java
>
>
> The issues is similar to this https://community.jboss.org/thread/197482. Notice 'hibernate.transaction.jta.platform' and 'hibernate.transaction.factory_class' properties. Here Hibernate is joining existing transaction. SynchronizationCallbackCoordinatorImpl tries to mark transaction for rollback when exception occurs, the chain of calls results in NullPointerException at TransactionCoordinatorImpl.setRollbackOnly(). To simulate the scenario, I modified BasicDrivingTest(https://github.com/hibernate/hibernate-orm/blob/master/hibernate-core/src/test/java/org/hibernate/test/transaction/jta/BasicDrivingTest.java) which is attached with this issue(check line 76)
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the hibernate-issues
mailing list