Class AbstractTransaction

java.lang.Object
org.tentackle.dbms.AbstractTransaction
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
DbTransaction, RemoteTransaction

public abstract class AbstractTransaction extends Object implements Serializable
Base class for a transaction.
See Also:
  • Constructor Details

    • AbstractTransaction

      public AbstractTransaction(long txVoucher, String txName, long txNumber, int txLevel)
      Creates a transaction object.
      Parameters:
      txVoucher - the transaction voucher
      txName - the transaction name, null if default unnamed
      txNumber - the transaction number
      txLevel - the initial nesting level (usually 1)
  • Method Details

    • getSession

      public Db getSession()
      Gets the session.
      Returns:
      the session
    • setSession

      public void setSession(Db session)
      Sets the session.
      Parameters:
      session - the session to set
    • getTxVoucher

      public long getTxVoucher()
      Gets the transaction voucher.
      Returns:
      the transaction voucher
    • getTxName

      public String getTxName()
      Gets the transaction name.
      Returns:
      the transaction name, never null
    • getTxNumber

      public long getTxNumber()
      Gets the transaction number.
      Returns:
      the transaction number
    • getTxLevel

      public int getTxLevel()
      Gets the transaction nesting level.
      Returns:
      the nesting level
    • incrementTxLevel

      public void incrementTxLevel(String txName)
      Increments the transaction level.
    • decrementTxLevel

      public void decrementTxLevel()
      Decrements the transaction level.
    • invalidateTxLevel

      public void invalidateTxLevel()
      Marks the txLevel invalid.

      Will suppress any checks and warnings.

    • isTxLevelValid

      public boolean isTxLevelValid()
      Returns whether the txLevel is valid.
      Returns:
      true if valid
    • toString

      public String toString()
      Overrides:
      toString in class Object