| 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 |