com.hazelcast.transaction
Interface TransactionContext

All Superinterfaces:
TransactionalTaskContext
All Known Implementing Classes:
TransactionContextProxy

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.
 XAResource getXaResource()
          Gets xaResource which will participate in XATransaction
 boolean isXAManaged()
          Indicates that related transaction is managed by XAResource
 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.

getXaResource

XAResource getXaResource()
Gets xaResource which will participate in XATransaction

Returns:
the xaResource.

isXAManaged

boolean isXAManaged()
Indicates that related transaction is managed by XAResource

Returns:
true if related transaction is managed by XAResource, false otherwise


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