Class Transaction

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void abort()  
      void begin()  
      void commit()  
      void end()  
      void ensureWriteTxn()
      Require a WRITE transaction - includes trying to promote.
      long getDataVersion()
      Each transaction is allocated a serialization point by the transaction coordinator.
      ReadWrite getMode()
      What mode is this transaction? This may change from READ to WRITE in a transactions lifetime.
      TxnState getState()
      The transaction lifecycle state
      TxnId getTxnId()
      Get the transaction id for this transaction.
      TxnType getTxnType()
      What type is this transaction? This is the initial TxnType and does not change during a transaction's lifetime.
      boolean hasFinalised()
      Has the transaction gone through all lifecycle states?
      boolean hasFinished()
      Has the transaction finished (has commit/abort/end been called)?
      boolean hasStarted()
      Has the transaction started?
      boolean isActiveTxn()
      Is this a view of a transaction that is active? Equivalent to getState() != INACTIVE
      boolean isReadTxn()
      Is this a READ transaction? Convenience operation equivalent to (getMode() == READ)
      boolean isWriteTxn()
      Is this a WRITE transaction? Convenience operation equivalent to (getMode() == WRITE)
      void notifyUpdate()  
      void prepare()  
      boolean promote()  
      boolean promote​(boolean readCommitted)  
      void requireWriteTxn()
      Require a WRITE transaction - do not try to promote.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Transaction

        public Transaction​(TransactionCoordinator txnMgr,
                           TxnType txnType,
                           ReadWrite readWrite,
                           TxnId txnId,
                           long dataVersion,
                           java.util.List<org.apache.jena.dboe.transaction.txn.SysTrans> components)
    • Method Detail

      • getDataVersion

        public long getDataVersion()
        Each transaction is allocated a serialization point by the transaction coordinator. Normally, this is related to this number and it increases over time as the data changes. Two readers can have the same serialization point - they are working with the same view of the data.
        Specified by:
        getDataVersion in interface TransactionInfo
      • begin

        public void begin()
      • promote

        public boolean promote()
      • promote

        public boolean promote​(boolean readCommitted)
      • notifyUpdate

        public void notifyUpdate()
      • prepare

        public void prepare()
      • commit

        public void commit()
      • abort

        public void abort()
      • end

        public void end()
      • requireWriteTxn

        public void requireWriteTxn()
        Require a WRITE transaction - do not try to promote.
      • ensureWriteTxn

        public void ensureWriteTxn()
        Require a WRITE transaction - includes trying to promote.
      • hasFinished

        public boolean hasFinished()
        Description copied from interface: TransactionInfo
        Has the transaction finished (has commit/abort/end been called)?
        Specified by:
        hasFinished in interface TransactionInfo
      • hasFinalised

        public boolean hasFinalised()
        Description copied from interface: TransactionInfo
        Has the transaction gone through all lifecycle states?
        Specified by:
        hasFinalised in interface TransactionInfo
      • getTxnId

        public TxnId getTxnId()
        Description copied from interface: TransactionInfo
        Get the transaction id for this transaction. Unique within this OS process (JVM) at least .
        Specified by:
        getTxnId in interface TransactionInfo
      • getTxnType

        public TxnType getTxnType()
        Description copied from interface: TransactionInfo
        What type is this transaction? This is the initial TxnType and does not change during a transaction's lifetime.
        Specified by:
        getTxnType in interface TransactionInfo
      • getMode

        public ReadWrite getMode()
        Description copied from interface: TransactionInfo
        What mode is this transaction? This may change from READ to WRITE in a transactions lifetime.
        Specified by:
        getMode in interface TransactionInfo
      • isReadTxn

        public boolean isReadTxn()
        Is this a READ transaction? Convenience operation equivalent to (getMode() == READ)
        Specified by:
        isReadTxn in interface TransactionInfo
      • isWriteTxn

        public boolean isWriteTxn()
        Is this a WRITE transaction? Convenience operation equivalent to (getMode() == WRITE)
        Specified by:
        isWriteTxn in interface TransactionInfo
      • isActiveTxn

        public boolean isActiveTxn()
        Description copied from interface: TransactionInfo
        Is this a view of a transaction that is active? Equivalent to getState() != INACTIVE
        Specified by:
        isActiveTxn in interface TransactionInfo