#2262 - Transaction postCommit Callback not invoked when the active transaction has no database writes

This commit is contained in:
rbygrave committed 2021-07-13 14:45:48 +12:00
1 parent 6fb28d7ded
commit 8840628d34
2 files changed
+27 -5

No files matched your search

@@ -941,11 +941,13 @@ class JdbcTransaction implements SpiTransaction, TxnProfileEventCodes {
*/
private void connectionEndForQueryOnly() {
try {
withEachCallback(TransactionCallback::preCommit);
if (onQueryOnly == OnQueryOnly.COMMIT) {
performCommit();
} else {
performRollback();
}
withEachCallback(TransactionCallback::postCommit);
} catch (SQLException e) {
logger.error("Error when ending a query only transaction via " + onQueryOnly, e);
}