public interface TransactionWriter extends CacheCallback
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().
CacheTransactionManager.setWriter(org.apache.geode.cache.TransactionWriter)
Modifier and Type | Method and Description |
---|---|
void |
beforeCommit(TransactionEvent event)
Called before the transaction has finished committing, but after conflict checking.
|
close
init, initialize
void beforeCommit(TransactionEvent event) throws TransactionWriterException
event
- the TransactionEventTransactionWriterException
- in the event that the transaction should be rolled backCacheTransactionManager.commit()