Package io.meeds.common
Class TransactionCallbacks
java.lang.Object
io.meeds.common.TransactionCallbacks
Callbacks run once the JPA transaction of the current thread completes
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanafterCompletion(Runnable callback) Registers a callback run once the JPA transaction active on the current thread completes, whether it's committed or rolled back.
-
Method Details
-
afterCompletion
Registers a callback run once the JPA transaction active on the current thread completes, whether it's committed or rolled back. A cache eviction made inside a transaction is repeated this way: a concurrent read made before the commit caches the previous state again.- Parameters:
callback- the callback to run, its errors are logged- Returns:
- true when the callback is registered, false when no JPA transaction is active on the thread: the callback isn't run then
-