Interface TransactionContext

All Known Implementing Classes:
Transaction

public sealed interface TransactionContext permits Transaction
A subset of a Transaction that lets journals properly record, manage their state, or open inner transactions, but does not allow them to close the transaction they are passed.

Recording changes to a transaction can be done with an implementation of SnapshotJournal and calling updateSnapshots(TransactionContext) before having the state change.

See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Gets the current depth of the transaction.
  • Method Details

    • depth

      int depth()
      Gets the current depth of the transaction.
      Returns:
      The depth of this transaction: 0 if it is the root and has no parent; 1 or more otherwise indicating how far away from the root the transaction is.
      Throws:
      IllegalStateException - If this function is not called on the thread this transaction was opened in.