Last active
June 11, 2018 12:36
-
-
Save cherniag/2b6b8048fe6781abea30a2ab04a87a36 to your computer and use it in GitHub Desktop.
Spring application event after transaction commit
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
need to perform some actions on entity after it had been commited using spring app events? | |
Use (instead of @EventListener): | |
@TransactionalEventListener(classes = MyEvent.class) | |
(note that inside new transaction is required to perform actions!) | |
https://spring.io/blog/2015/02/11/better-application-events-in-spring-framework-4-2 | |
https://dzone.com/articles/transaction-synchronization-and-spring-application |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment