This question was raised in comment section of Hibernate interceptor and event listeners .
Below is my answer on that.
The POST_COMMIT_UPDATE
and POST_UPDATE
are the events of type PostUpdateEventListener
that occurs after the datastore is updated.
1) The POST_COMMIT_UPDATE
should be used, if after transaction hooks need to be registered.
The method requiresPostCommitHandling returns true if after transaction callbacks should be added.
Here, is an example that depicts the use of POST_COMMIT_UPDATE
.
2) The plain POST_UPDATE
event is triggered based on hibernate flushing logic.
Here is an example of POST_UPDATE
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With