Class DefaultTransactionContext

java.lang.Object
io.camunda.zeebe.db.impl.rocksdb.transaction.DefaultTransactionContext
All Implemented Interfaces:
TransactionContext

public final class DefaultTransactionContext extends Object implements TransactionContext
  • Method Details

    • runInTransaction

      public void runInTransaction(TransactionOperation operations)
      Description copied from interface: TransactionContext
      Runs the commands like delete, put etc. in a transaction. Access of different column families inside this transaction are possible.

      Reading key-value pairs via get or an iterator is also possible and will reflect changes, which are made during the transaction.

      NOTE: It is allowed to nest these calls. The transaction will then be reused (it will run in the same transaction). If the outer call ends, the transaction will be committed. On an error the transaction is rolled back.

      Specified by:
      runInTransaction in interface TransactionContext
      Parameters:
      operations - the operations
    • getCurrentTransaction

      public ZeebeDbTransaction getCurrentTransaction()
      Description copied from interface: TransactionContext
      This will return an transaction object, on which the caller can operate on. The caller is free to decide when to commit or rollback the transaction.
      Specified by:
      getCurrentTransaction in interface TransactionContext
      Returns:
      the transaction object