com.hazelcast.transaction
Interface TransactionContext

All Superinterfaces:
TransactionalTaskContext
All Known Subinterfaces:
ClientTransactionContext
All Known Implementing Classes:
TransactionContextProxy, XATransactionContextImpl, XATransactionContextProxy

public interface TransactionContext
extends TransactionalTaskContext

Provides a context to perform transactional operations: 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.
 XAResource getXaResource()
          Deprecated. since 3.5 please use HazelcastInstance.getXAResource()
 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 there is no active transaction.

getTxnId

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

Returns:
the transaction id.

getXaResource

@Deprecated
XAResource getXaResource()
Deprecated. since 3.5 please use HazelcastInstance.getXAResource()

Gets xaResource which will participate in XATransaction.

Returns:
the xaResource.


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