java.lang.Object
org.apache.jena.dboe.transaction.txn.TransactionalBase
All Implemented Interfaces:
Transactional, TransactionalSystem, org.apache.jena.sparql.core.Transactional

public class TransactionalBase extends Object implements TransactionalSystem
Framework for implementing a Transactional via TransactionalSystem. This base class provides the "per thread" aspect - the TransactionCoordinator itself is not thread aware.
  • Constructor Details

  • Method Details

    • getTxnMgr

      public TransactionCoordinator getTxnMgr()
      Description copied from interface: TransactionalSystem
      Get the associated TransactionCoordinator
      Specified by:
      getTxnMgr in interface TransactionalSystem
    • detach

      public TransactionCoordinatorState detach()
      Description copied from interface: TransactionalSystem
      Suspend this transaction, detaching from the current thread. A new transaction on this thread can performed but the detached transaction still exists and if it is a write transaction it can still block other write transactions.
      Specified by:
      detach in interface TransactionalSystem
    • attach

      public void attach(TransactionCoordinatorState coordinatorState)
      Description copied from interface: TransactionalSystem
      Attach a transaction to this thread. A transaction system implementation usually imposes a rule that only one thread can have a transaction attached at a time.
      Specified by:
      attach in interface TransactionalSystem
    • begin

      public final void begin(org.apache.jena.query.ReadWrite readWrite)
      Specified by:
      begin in interface org.apache.jena.sparql.core.Transactional
    • begin

      public final void begin(org.apache.jena.query.TxnType txnType)
      Specified by:
      begin in interface org.apache.jena.sparql.core.Transactional
    • promote

      public final boolean promote()
      Specified by:
      promote in interface org.apache.jena.sparql.core.Transactional
    • promote

      public final boolean promote(org.apache.jena.sparql.core.Transactional.Promote promoteMode)
      Specified by:
      promote in interface org.apache.jena.sparql.core.Transactional
    • commit

      public final void commit()
      Specified by:
      commit in interface org.apache.jena.sparql.core.Transactional
      Specified by:
      commit in interface TransactionalSystem
    • commitPrepare

      public void commitPrepare()
      Description copied from interface: TransactionalSystem
      Do the 2-phase "prepare" step after which the transaction coordinator decides whether to commit or abort. A TransactionalSystem must be prepared for both possibilities.
      Specified by:
      commitPrepare in interface TransactionalSystem
    • commitExec

      public void commitExec()
      Description copied from interface: TransactionalSystem
      Do the 2-phase "commit" step
      Specified by:
      commitExec in interface TransactionalSystem
    • abort

      public final void abort()
      Specified by:
      abort in interface org.apache.jena.sparql.core.Transactional
    • end

      public final void end()
      Specified by:
      end in interface org.apache.jena.sparql.core.Transactional
    • transactionMode

      public org.apache.jena.query.ReadWrite transactionMode()
      Specified by:
      transactionMode in interface org.apache.jena.sparql.core.Transactional
    • transactionType

      public org.apache.jena.query.TxnType transactionType()
      Specified by:
      transactionType in interface org.apache.jena.sparql.core.Transactional
    • isInTransaction

      public boolean isInTransaction()
      Specified by:
      isInTransaction in interface org.apache.jena.sparql.core.Transactional
    • getTransactionInfo

      public final TransactionInfo getTransactionInfo()
      Description copied from interface: TransactionalSystem
      Return an information view of the transaction for this thread, if any. Returns null when there is no active transaction for this tread.
      Specified by:
      getTransactionInfo in interface TransactionalSystem
    • getThreadTransaction

      public final Transaction getThreadTransaction()
      Description copied from interface: TransactionalSystem
      Return the transaction object for this thread. Low-level use only. To get information about the current transaction, call TransactionalSystem.getTransactionInfo().
      Specified by:
      getThreadTransaction in interface TransactionalSystem
    • shutdown

      public void shutdown()
      Shutdown component, aborting any in-progress transactions. This operation is not guaranteed to be called.