Class StoreConnection

java.lang.Object
org.apache.jena.tdb.StoreConnection

public class StoreConnection extends Object
A StoreConnection is the reference to the underlying storage. There is JVM-wide cache of backing datasets. The work of transaction coordination is done in TransactionManager.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Indicate whether there are any active transactions.
    org.apache.jena.tdb.transaction.DatasetGraphTxn
    begin(TxnType mode)
    Begin a transaction.
    org.apache.jena.tdb.transaction.DatasetGraphTxn
    begin(TxnType mode, String label)
    Begin a transaction, giving it a label.
    Return a StoreConnection backed by in-memory datastructures (for testing).
    static void
    expel(org.apache.jena.tdb.base.file.Location location, boolean force)
    Stop managing a location.
    void
    Flush the delayed write queue to the base storage.
    void
    Flush the journal regardless - use with great case - do not use when transactions may be active.
    org.apache.jena.tdb.store.DatasetGraphTDB
    Internal operation - to get a dataset for application use, call a TDBFactory function.
    getExisting(org.apache.jena.tdb.base.file.Location location)
    Return the StoreConnection if one already exists for this location, else return null
    org.apache.jena.tdb.base.file.Location
     
    org.apache.jena.tdb.transaction.TransactionManager
    For internal use only
    org.apache.jena.tdb.transaction.SysTxnState
    Return a description of the transaction manager state
    boolean
     
    boolean
     
    make(String location)
    Obtain a StoreConnection for a particular location
    make(org.apache.jena.tdb.base.file.Location location)
    Make a StoreConnection based on any StoreParams at the location or the system defaults.
    make(org.apache.jena.tdb.base.file.Location location, org.apache.jena.tdb.setup.StoreParams params)
    Return a StoreConnection for a particular connection.
    void
    Highly risky!
    static void
    release(org.apache.jena.tdb.base.file.Location location)
    Stop managing a location.
    static void
    Stop managing all locations.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • isValid

      public boolean isValid()
    • haveUsedInTransaction

      public boolean haveUsedInTransaction()
    • getLocation

      public org.apache.jena.tdb.base.file.Location getLocation()
    • getTransMgrState

      public org.apache.jena.tdb.transaction.SysTxnState getTransMgrState()
      Return a description of the transaction manager state
    • begin

      public org.apache.jena.tdb.transaction.DatasetGraphTxn begin(TxnType mode)
      Begin a transaction. Terminate a write transaction with Transaction.commit() or Transaction.abort(). Terminate a write transaction with Transaction.close().
    • begin

      public org.apache.jena.tdb.transaction.DatasetGraphTxn begin(TxnType mode, String label)
      Begin a transaction, giving it a label. Terminate a write transaction with Transaction.commit() or Transaction.abort(). Terminate a write transaction with Transaction.close().
    • getBaseDataset

      public org.apache.jena.tdb.store.DatasetGraphTDB getBaseDataset()
      Internal operation - to get a dataset for application use, call a TDBFactory function. Do not use the base dataset without knowing how the transaction system uses it.
    • getTransactionManager

      public org.apache.jena.tdb.transaction.TransactionManager getTransactionManager()
      For internal use only
    • flush

      public void flush()
      Flush the delayed write queue to the base storage. This can only be done if there are no active transactions. If there are active transactions, nothing is done but this is safe to call.
    • activeTransactions

      public boolean activeTransactions()
      Indicate whether there are any active transactions.
      See Also:
    • forceRecoverFromJournal

      public void forceRecoverFromJournal()
      Flush the journal regardless - use with great case - do not use when transactions may be active.
    • printJournal

      public void printJournal()
      Highly risky!
    • make

      public static StoreConnection make(String location)
      Obtain a StoreConnection for a particular location
    • reset

      public static void reset()
      Stop managing all locations. Use with great care. Use via TDBInternal.expel(org.apache.jena.sparql.core.DatasetGraph) wherever possible.
    • release

      public static void release(org.apache.jena.tdb.base.file.Location location)
      Stop managing a location. There should be no transactions running. Use via TDBInternal.expel(org.apache.jena.sparql.core.DatasetGraph) wherever possible.
    • expel

      public static void expel(org.apache.jena.tdb.base.file.Location location, boolean force)
      Stop managing a location. Use with great care (testing only). Use via TDBInternal.expel(org.apache.jena.sparql.core.DatasetGraph) wherever possible.
    • make

      public static StoreConnection make(org.apache.jena.tdb.base.file.Location location, org.apache.jena.tdb.setup.StoreParams params)
      Return a StoreConnection for a particular connection. This is used to create transactions for the database at the location.
    • make

      public static StoreConnection make(org.apache.jena.tdb.base.file.Location location)
      Make a StoreConnection based on any StoreParams at the location or the system defaults.
    • getExisting

      public static StoreConnection getExisting(org.apache.jena.tdb.base.file.Location location)
      Return the StoreConnection if one already exists for this location, else return null
    • createMemUncached

      public static StoreConnection createMemUncached()
      Return a StoreConnection backed by in-memory datastructures (for testing).