[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-7215) NullPointerException in JtaTransaction when trying mark transaction for rollback
Christopher Wong (JIRA)
noreply at atlassian.com
Tue Apr 24 11:51:48 EDT 2012
[ https://hibernate.onjira.com/browse/HHH-7215?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46397#comment-46397 ]
Christopher Wong commented on HHH-7215:
---------------------------------------
I'm seeing this NPE too when using Spring's declarative transaction annotations (@Transactional) with JTA. A DB exception such as a unique constraint exception will cause this error.
> 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