You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not entirely sure what the expected behavior would be, but the actual behavior is that if a TransactionListener throws an exception from #commitEnd the call to TransactionProvider#rollback throws a NoSuchElementException. This occurs because the transaction was already successfully commited so a rollback can't occur and the transaction provider is expecting an element in the configurations Deque.
The NoSuchElementException is added to the suppressed exception list so the actual exception still bubbles up, but it is a bit weird. Even without the NoSuchElementException this presents a case where calls to DSLContext#transactionResult result in a RuntimeException but that a rollback did not occur; counter to the Javadoc 'indicating that a rollback has occurred.'
Clearly, the rollback logic must not be invoked when commit was successful.
lukaseder
changed the title
TransactionProvider#rollback throws a NoSuchElementException, if TransactionListener#commitEnd throws an exception
Rollback should not be called when TransactionListener.commitEnd() throws exception
Mar 14, 2019
Expected behavior and actual behavior:
I'm not entirely sure what the expected behavior would be, but the actual behavior is that if a
TransactionListener
throws an exception from#commitEnd
the call toTransactionProvider#rollback
throws aNoSuchElementException
. This occurs because the transaction was already successfully commited so a rollback can't occur and the transaction provider is expecting an element in the configurationsDeque
.The
NoSuchElementException
is added to the suppressed exception list so the actual exception still bubbles up, but it is a bit weird. Even without theNoSuchElementException
this presents a case where calls toDSLContext#transactionResult
result in aRuntimeException
but that a rollback did not occur; counter to the Javadoc 'indicating that a rollback has occurred.'Steps to reproduce the problem (if possible, create an MCVE: https://github.com/jOOQ/jOOQ-mcve):
https://github.com/johnlcox/jOOQ-mcve/tree/NoSuchElementException
Versions:
The text was updated successfully, but these errors were encountered: