Class TransactionState


  • public class TransactionState
    extends java.lang.Object

    This class manages the transaction state associated with every client session. The transaction state for the current session can be retrieved like this:

        TransactionState txnState = SessionState.get().getTransactionState()

    The transaction state should generally not be managed directly! Rather, the operations provided by the TransactionManager should be used.

    • Field Detail

      • transactionID

        private int transactionID
      • userStartedTxn

        private boolean userStartedTxn
      • performedWrites

        private boolean performedWrites
      • loggedTxnStart

        private boolean loggedTxnStart
        This value indicates whether the current transaction has been logged to the write-ahead log yet. We don't write the "Ti: start" record until the transaction performs its first write operation.
    • Constructor Detail

      • TransactionState

        public TransactionState()
    • Method Detail

      • getTransactionID

        public int getTransactionID()
      • setTransactionID

        public void setTransactionID​(int transactionID)
      • getUserStartedTxn

        public boolean getUserStartedTxn()
      • setUserStartedTxn

        public void setUserStartedTxn​(boolean b)
      • hasPerformedWrites

        public boolean hasPerformedWrites()
      • setPerformedWrites

        public void setPerformedWrites​(boolean b)
      • hasLoggedTxnStart

        public boolean hasLoggedTxnStart()
      • setLoggedTxnStart

        public void setLoggedTxnStart​(boolean b)
      • clear

        public void clear()
      • isTxnInProgress

        public boolean isTxnInProgress()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object