Class DatasetGraphTxnCtl

java.lang.Object
org.apache.jena.sparql.core.DatasetGraphWrapper
org.apache.jena.dboe.storage.system.DatasetGraphTxnCtl
All Implemented Interfaces:
org.apache.jena.atlas.lib.Closeable, org.apache.jena.atlas.lib.Sync, org.apache.jena.dboe.transaction.txn.TransactionalSystemControl, DatasetGraph, Transactional

public class DatasetGraphTxnCtl extends DatasetGraphWrapper implements org.apache.jena.dboe.transaction.txn.TransactionalSystemControl
DatasetGraph wrapper controls entry and exit of transactions.
  • Exclusive access (no transactions active)
  • Read only database - No possible writers (write and promotable transactions)
  • Constructor Details

  • Method Details

    • begin

      public void begin(TxnType txnType)
      Specified by:
      begin in interface Transactional
      Overrides:
      begin in class DatasetGraphWrapper
    • begin

      public void begin(ReadWrite readWrite)
      Specified by:
      begin in interface Transactional
      Overrides:
      begin in class DatasetGraphWrapper
    • commit

      public void commit()
      Specified by:
      commit in interface Transactional
      Overrides:
      commit in class DatasetGraphWrapper
    • abort

      public void abort()
      Specified by:
      abort in interface Transactional
      Overrides:
      abort in class DatasetGraphWrapper
    • end

      public void end()
      Specified by:
      end in interface Transactional
      Overrides:
      end in class DatasetGraphWrapper
    • startReadOnlyDatabase

      public void startReadOnlyDatabase()
      Block until no writers or promote transactions present are present.
      Specified by:
      startReadOnlyDatabase in interface org.apache.jena.dboe.transaction.txn.TransactionalSystemControl
    • finishReadOnlyDatabase

      public void finishReadOnlyDatabase()
      Release any waiting potential writers.
      Specified by:
      finishReadOnlyDatabase in interface org.apache.jena.dboe.transaction.txn.TransactionalSystemControl
    • startNonExclusiveMode

      public void startNonExclusiveMode()
      Specified by:
      startNonExclusiveMode in interface org.apache.jena.dboe.transaction.txn.TransactionalSystemControl
    • tryNonExclusiveMode

      public boolean tryNonExclusiveMode(boolean canBlock)
      Specified by:
      tryNonExclusiveMode in interface org.apache.jena.dboe.transaction.txn.TransactionalSystemControl
    • finishNonExclusiveMode

      public void finishNonExclusiveMode()
      Specified by:
      finishNonExclusiveMode in interface org.apache.jena.dboe.transaction.txn.TransactionalSystemControl
    • startExclusiveMode

      public void startExclusiveMode()
      Enter exclusive mode; block if necessary. There are no active transactions on return; new transactions will be held up in 'begin'. Return to normal (release waiting transactions, allow new transactions) with finishExclusiveMode().

      Do not call inside an existing transaction.

      Specified by:
      startExclusiveMode in interface org.apache.jena.dboe.transaction.txn.TransactionalSystemControl
    • tryExclusiveMode

      public boolean tryExclusiveMode()
      Try to enter exclusive mode. If return is true, then there are no active transactions on return and new transactions will be held up in 'begin'. If false, there were in-progress transactions. Return to normal (release waiting transactions, allow new transactions) with finishExclusiveMode().

      Do not call inside an existing transaction.

      Specified by:
      tryExclusiveMode in interface org.apache.jena.dboe.transaction.txn.TransactionalSystemControl
    • tryExclusiveMode

      public boolean tryExclusiveMode(boolean canBlock)
      Try to enter exclusive mode. If return is true, then there are no active transactions on return and new transactions will be held up in 'begin'. If false, there were in-progress transactions. Return to normal (release waiting transactions, allow new transactions) with finishExclusiveMode().

      Do not call inside an existing transaction.

      Specified by:
      tryExclusiveMode in interface org.apache.jena.dboe.transaction.txn.TransactionalSystemControl
      Parameters:
      canBlock - Allow the operation block and wait for the exclusive mode lock.
    • finishExclusiveMode

      public void finishExclusiveMode()
      Return to normal (release waiting transactions, allow new transactions). Must be paired with an earlier startExclusiveMode().
      Specified by:
      finishExclusiveMode in interface org.apache.jena.dboe.transaction.txn.TransactionalSystemControl