org.apache.ignite.transactions

## Interface TransactionSynchronization

    public interface TransactionSynchronization

Synchronization callback for transaction. You can subscribe to receive transaction state change callbacks by registering transaction synchronization via `GridCache.txSynchronize(TransactionSynchronization)` method.

### Method Summary

Methods
`void` `onStateChanged(TransactionState prevState, TransactionState newState, Transaction tx)` State change callback for transaction.

### Method Detail

#### onStateChanged

    void onStateChanged(@Nullable
                      TransactionState prevState,
                      TransactionState newState,
                      Transaction tx)

State change callback for transaction. Note that unless transaction has been completed, it is possible to mark it for `rollbackOnly` by calling `Transaction.setRollbackOnly()` on the passed in transaction. You can check the return value of `setRollbackOnly()` method to see if transaction was indeed marked for rollback or not.

Parameters:
  `prevState` - Previous state of the transaction. If transaction has just been started, then previous state is `null`.
  `newState` - New state of the transaction. In majority of the cases this will be the same as `tx.state()`, but it is also possible that transaction may be marked for rollback concurrently with this method invocation, and in that case `newState` reflects the actual state of the transition this callback is associated with.
  `tx` - Transaction whose state has changed.

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.0.0-RC1
Release Date | : February 17 2015