Michiel Hendriks (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=5e8c272...
) *created* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiN2YyYTY2Y2Fi...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-13936?atlOrigin=eyJpIjoiN2YyYT...
) HHH-13936 (
https://hibernate.atlassian.net/browse/HHH-13936?atlOrigin=eyJpIjoiN2YyYT...
) No auto transaction joining from SessionImpl.doFlush (
https://hibernate.atlassian.net/browse/HHH-13936?atlOrigin=eyJpIjoiN2YyYT...
)
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=5e8c272...
)
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=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-13936#add-comment?atlOrigin=ey...
)
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....
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=Em...
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100124- sha1:c13ca0d )