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 the TransactionalMap. Any method accessed through TransactionContext interface can throw TransactionException if transaction is no longer valid and rolled back.
  • Method Details

    • 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

      UUID getTxnId()
      Gets the ID that uniquely identifies the transaction.
      Returns:
      the transaction ID