Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TransactionalEventListener seperate phase AFTER_COMPLETION and AFTER_COMMIT for a group of events [SPR-15323] #19886

spring-projects-issues opened this issue Mar 7, 2017 · 1 comment
in: data status: declined type: enhancement


Copy link

@spring-projects-issues spring-projects-issues commented Mar 7, 2017

Mark Czubin opened SPR-15323 and commented

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.

Affects: 4.3.7

Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Mar 7, 2017

Juergen Hoeller commented

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.

@spring-projects-issues spring-projects-issues added status: declined in: data type: enhancement labels Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
in: data status: declined type: enhancement
None yet

No branches or pull requests

2 participants