[
https://issues.jboss.org/browse/WFLY-10229?page=com.atlassian.jira.plugin...
]
Scott Marlow commented on WFLY-10229:
-------------------------------------
[~tomjenkinson] yeah, this is a problem that we noticed with our testing. Let me know if
you would like a forward of the private email thread (getting quite long now). Some more
details are below.
In a test that starts a JTA transaction, invokes an EntityManager.persist operation
expected to throw an exception (which marks the transaction for rollback only), however
soon after the exception is thrown, the test code now has control and calls
entityManager.find() which throws an exception instead of returning null. The first place
in Hibernate ORM 5.3, that we go wrong, is getting the transaction status via the
TransactionSynchronizationRegistry. Hibernate has the correct
TransactionSynchronizationRegistry instance but internally, the
TransactionSynchronizationRegistry has a reference to
the com.arjuna.ats.jta.TransactionManager, Hibernate gets the incorrect TX status code (1,
when status should be 4). Instead the TSR should use
org.wildfly.transaction.client.ContextTransactionManager.getStatus(), so that Hibernate
goes down the correct code path.
Point of failure is:
{code}
at
org.hibernate.engine.transaction.jta.platform.internal.SynchronizationRegistryBasedSynchronizationStrategy.canRegisterSynchronization(SynchronizationRegistryBasedSynchronizationStrategy.java:37)
at
org.hibernate.engine.transaction.jta.platform.internal.AbstractJtaPlatform.canRegisterSynchronization(AbstractJtaPlatform.java:131)
at
org.hibernate.resource.transaction.backend.jta.internal.JtaTransactionCoordinatorImpl.pulse(JtaTransactionCoordinatorImpl.java:154)
at
org.hibernate.internal.AbstractSharedSessionContract.pulseTransactionCoordinator(AbstractSharedSessionContract.java:451)
at
org.hibernate.internal.AbstractSharedSessionContract.checkTransactionSynchStatus(AbstractSharedSessionContract.java:445)
at org.hibernate.internal.SessionImpl.fireLoad(SessionImpl.java:1252)
at org.hibernate.internal.SessionImpl.access$1900(SessionImpl.java:206)
at
org.hibernate.internal.SessionImpl$IdentifierLoadAccessImpl.doLoad(SessionImpl.java:2864)
at
org.hibernate.internal.SessionImpl$IdentifierLoadAccessImpl.load(SessionImpl.java:2838)
at org.hibernate.internal.SessionImpl.find(SessionImpl.java:3473)
at org.hibernate.internal.SessionImpl.find(SessionImpl.java:3437)
at
org.jboss.as.jpa.container.AbstractEntityManager.find(AbstractEntityManager.java:213)
{code}
org.jboss.as.txn.service.internal.tsr.TransactionSynchronizationRegistryWrapper.getStatus()
should use org.wildfly.transaction.client.ContextTransactionManager.getStatus()
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Key: WFLY-10229
URL:
https://issues.jboss.org/browse/WFLY-10229
Project: WildFly
Issue Type: Task
Components: Transactions
Reporter: Scott Marlow
Assignee: David Lloyd
Fix For: 13.0.0.Beta1
org.jboss.as.txn.service.internal.tsr.TransactionSynchronizationRegistryWrapper.getStatus()
is currently using com.arjuna.ats.jta.TransactionManager, instead it should use
org.wildfly.transaction.client.ContextTransactionManager.getStatus().
I'm seeing a case in Hibernate ORM 5.3, where
org.wildfly.transaction.client.ContextTransactionManager.getStatus() returns 4 but
TransactionSynchronizationRegistryWrapper.getStatus() returns 1.
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)