[hibernate-issues] [JIRA] (HHH-13936) No auto transaction joining from SessionImpl.doFlush

Michiel Hendriks (JIRA) jira at hibernate.atlassian.net
Tue Apr 7 06:12:18 EDT 2020


Michiel Hendriks ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=5e8c2724ccedcb0b8d1b3c77 ) *created* an issue

Hibernate ORM ( https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiN2YyYTY2Y2FiZDU2NGE0NGJlNTQxMTBlOWRiMjRjN2EiLCJwIjoiaiJ9 ) / Bug ( https://hibernate.atlassian.net/browse/HHH-13936?atlOrigin=eyJpIjoiN2YyYTY2Y2FiZDU2NGE0NGJlNTQxMTBlOWRiMjRjN2EiLCJwIjoiaiJ9 ) HHH-13936 ( https://hibernate.atlassian.net/browse/HHH-13936?atlOrigin=eyJpIjoiN2YyYTY2Y2FiZDU2NGE0NGJlNTQxMTBlOWRiMjRjN2EiLCJwIjoiaiJ9 ) No auto transaction joining from SessionImpl.doFlush ( https://hibernate.atlassian.net/browse/HHH-13936?atlOrigin=eyJpIjoiN2YyYTY2Y2FiZDU2NGE0NGJlNTQxMTBlOWRiMjRjN2EiLCJwIjoiaiJ9 )

Issue Type: Bug Affects Versions: 5.4.15 Assignee: Unassigned Components: hibernate-core Created: 07/Apr/2020 03:12 AM Priority: Major Reporter: Michiel Hendriks ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=5e8c2724ccedcb0b8d1b3c77 )

In SessionImpl.doFlush the call to checkTransactionNeededForUpdateOperation will throw an exception TransactionRequiredException if the session was opened before a transaction started, and no other major session methods have been called yet (in case of a JTA setup).
This is because the TransactionCoordinator returns false on isTransactionActive when isJoined is false.
In most other major session methods a call to pulseTransactionCoordinator is done which would auto join an available transaction. This is also done in doFlush but only after the call to checkTransactionNeededForUpdateOperation.
If these calls would be switched around the session would join the active transaction and doFlush would succeed successfully.

I don't know how long this issue existed, but at least since 5.4.12

( https://hibernate.atlassian.net/browse/HHH-13936#add-comment?atlOrigin=eyJpIjoiN2YyYTY2Y2FiZDU2NGE0NGJlNTQxMTBlOWRiMjRjN2EiLCJwIjoiaiJ9 ) Add Comment ( https://hibernate.atlassian.net/browse/HHH-13936#add-comment?atlOrigin=eyJpIjoiN2YyYTY2Y2FiZDU2NGE0NGJlNTQxMTBlOWRiMjRjN2EiLCJwIjoiaiJ9 )

Get Jira notifications on your phone! Download the Jira Cloud app for Android ( https://play.google.com/store/apps/details?id=com.atlassian.android.jira.core&referrer=utm_source%3DNotificationLink%26utm_medium%3DEmail ) or iOS ( https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=EmailNotificationLink&mt=8 ) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100124- sha1:c13ca0d )
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/hibernate-issues/attachments/20200407/791bf00d/attachment.html 


More information about the hibernate-issues mailing list