Interface TransactionListener
- All Superinterfaces:
CacheCallback,Declarable
- All Known Implementing Classes:
TransactionListenerAdapter
A listener that can be implemented to handle transaction related events. The methods on
TransactionListener are invoked synchronously after the operation, commit or
rollback, completes. The transaction that causes the listener to be called will no longer exist
at the time the listener code executes. The thread that performed the transaction operation will
not see that operation complete until the listener method completes its execution.
Multiple transactions, on the same cache, can cause concurrent invocation of
TransactionListener methods. Any exceptions thrown by the listener are caught and
logged.
Rollback and failed commit operations are local.
WARNING: To avoid risk of deadlock, do not invoke CacheFactory.getAnyInstance() from within any callback methods. Instead use TransactionEvent.getCache().
- Since:
- GemFire 4.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidafterCommit(TransactionEvent event) Called after a successful commit of a transaction.voidCalled after an unsuccessful commit operation.voidafterRollback(TransactionEvent event) Called after an explicit rollback of a transaction.Methods inherited from interface org.apache.geode.cache.CacheCallback
closeMethods inherited from interface org.apache.geode.cache.Declarable
init, initialize
-
Method Details
-
afterCommit
Called after a successful commit of a transaction.- Parameters:
event- the TransactionEvent- See Also:
-
afterFailedCommit
Called after an unsuccessful commit operation.- Parameters:
event- the TransactionEvent- See Also:
-
afterRollback
Called after an explicit rollback of a transaction.- Parameters:
event- the TransactionEvent- See Also:
-