Package com.hazelcast.transaction
Interface TransactionContext
-
- All Superinterfaces:
TransactionalTaskContext
public interface TransactionContext extends TransactionalTaskContext
Provides a context to perform transactional operations: beginning/committing transactions, but also retrieving transactional data-structures like theTransactionalMap
. Any method accessed through TransactionContext interface can throw TransactionException if transaction is no longer valid and rolled back.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
beginTransaction()
Begins a transaction.void
commitTransaction()
Commits a transaction.java.util.UUID
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:
java.lang.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:
java.lang.IllegalStateException
- if there is no active transaction.
-
getTxnId
java.util.UUID getTxnId()
Gets the ID that uniquely identifies the transaction.- Returns:
- the transaction ID
-
-