Currently the TransactionSynchronizationEventAdapter will handle both TransactionPhase.AFTER_COMPLETION and TransactionPhase.AFTER_COMMIT
in the same callback function:TransactionSynchronization::afterCompletion.
I would expect TransactionPhase.AFTER_COMMIT to be handled inside TransactionSynchronization::afterCommit.
So all events will first be handled in TransactionPhase.AFTER_COMMIT
and afterwards all events will be handled in TransactionPhase.AFTER_COMPLETION.
Now they are handled at the same time.
The text was updated successfully, but these errors were encountered:
For better or for worse, this is by design: TransactionPhase defines AFTER_COMMIT and AFTER_ROLLBACK as specializations of AFTER_COMPLETION and explicitly links all of them to TransactionSynchronization.afterCompletion in its javadoc. Semantically this is decoupled from TransactionSynchronization's other callbacks, even if a same-named afterCommit exists there. I'll add an explicit note on this to the javadoc.