com.hazelcast.transaction
Interface TransactionContext

All Superinterfaces:
TransactionalTaskContext

public interface TransactionContext
extends TransactionalTaskContext

Provides a context to do transactional operations; so beginning/committing transactions, but also retrieving transactional data-structures like the TransactionalMap.


Method Summary
 void beginTransaction()
          Begins a transaction.
 void commitTransaction()
          Commits a transaction.
 String getTxnId()
          Gets the id that uniquely identifies the transaction.
 void rollbackTransaction()
          Rollback of the current transaction.
 
Methods inherited from interface com.hazelcast.transaction.TransactionalTaskContext
getList, getMap, getMultiMap, getQueue, getSet, getTransactionalObject
 

Method Detail

beginTransaction

void beginTransaction()
Begins a transaction.

Throws:
IllegalStateException - if a transaction already is active.

commitTransaction

void commitTransaction()
                       throws TransactionException
Commits a transaction.

Throws:
TransactionException - if no transaction is active or the transaction could not be committed.

rollbackTransaction

void rollbackTransaction()
Rollback of the current transaction.

Throws:
IllegalStateException - if no there is no active transaction.

getTxnId

String getTxnId()
Gets the id that uniquely identifies the transaction.

Returns:
the transaction id.


Copyright © 2013 Hazelcast, Inc.. All Rights Reserved.