Package org.apache.geode.cache
Interface TransactionWriter
- All Superinterfaces:
CacheCallback,Declarable
A callback that is allowed to veto a transaction. Only one TransactionWriter can exist per cache,
and only one TransactionWriter will be fired in the entire distributed system for each
transaction.
This writer can be used to update a backend data source before the GemFire cache is updated
during commit. If the backend update fails, the implementer can throw a
TransactionWriterException to veto the transaction.
WARNING: To avoid risk of deadlock, do not invoke CacheFactory.getAnyInstance() from within any callback methods. Instead use TransactionEvent.getCache().
- Since:
- GemFire 6.5
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidbeforeCommit(TransactionEvent event) Called before the transaction has finished committing, but after conflict checking.Methods inherited from interface org.apache.geode.cache.CacheCallback
closeMethods inherited from interface org.apache.geode.cache.Declarable
init, initialize
-
Method Details
-
beforeCommit
Called before the transaction has finished committing, but after conflict checking. Provides an opportunity for implementors to cause transaction abort by throwing a TransactionWriterException- Parameters:
event- the TransactionEvent- Throws:
TransactionWriterException- in the event that the transaction should be rolled back- See Also:
-