Module org.apache.jena.dboe.storage
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,org.apache.jena.sparql.core.DatasetGraph,org.apache.jena.sparql.core.Transactional
public class DatasetGraphTxnCtl
extends org.apache.jena.sparql.core.DatasetGraphWrapper
implements org.apache.jena.dboe.transaction.txn.TransactionalSystemControl
A
DatasetGraph wrapper that controls entry and exit of transactions.
It provides two controls:
- Exclusive access - no transactions active (used by TDB2 compact)
- Read-only database - No possible writers (that is, transaction types write and the promote forms transactions)
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.jena.sparql.core.Transactional
org.apache.jena.sparql.core.Transactional.Promote -
Constructor Summary
ConstructorsConstructorDescriptionDatasetGraphTxnCtl(org.apache.jena.sparql.core.DatasetGraph dsg) DatasetGraphTxnCtl(org.apache.jena.sparql.core.DatasetGraph dsg, org.apache.jena.sparql.util.Context context) -
Method Summary
Modifier and TypeMethodDescriptionvoidabort()voidbegin(org.apache.jena.query.ReadWrite readWrite) voidbegin(org.apache.jena.query.TxnType txnType) voidcommit()voidend()voidReturn to normal (release waiting transactions, allow new transactions).voidvoidRelease any waiting potential writers.voidEnter exclusive mode; block if necessary.voidvoidBlock until no writers or promote transactions present are present.booleanTry to enter exclusive mode.booleantryExclusiveMode(boolean canBlock) Try to enter exclusive mode.booleantryNonExclusiveMode(boolean canBlock) Methods inherited from class org.apache.jena.sparql.core.DatasetGraphWrapper
add, add, addGraph, begin, clear, close, contains, contains, containsGraph, delete, delete, deleteAny, find, find, find, findNG, getBase, getBaseForQuery, getContext, getDefaultGraph, getGraph, getLock, getUnionGraph, getWrapped, isEmpty, isInTransaction, listGraphNodes, prefixes, promote, promote, removeGraph, size, supportsTransactionAbort, supportsTransactions, sync, toString, transactionMode, transactionType, unwrapMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.jena.sparql.core.DatasetGraph
addAll, stream, streamMethods inherited from interface org.apache.jena.sparql.core.Transactional
calc, calculate, calculateRead, calculateWrite, exec, execute, executeRead, executeWriteMethods inherited from interface org.apache.jena.dboe.transaction.txn.TransactionalSystemControl
execExclusive, execReadOnlyDatabase, tryNonExclusiveMode
-
Constructor Details
-
DatasetGraphTxnCtl
public DatasetGraphTxnCtl(org.apache.jena.sparql.core.DatasetGraph dsg) -
DatasetGraphTxnCtl
public DatasetGraphTxnCtl(org.apache.jena.sparql.core.DatasetGraph dsg, org.apache.jena.sparql.util.Context context)
-
-
Method Details
-
begin
public void begin(org.apache.jena.query.TxnType txnType) - Specified by:
beginin interfaceorg.apache.jena.sparql.core.Transactional- Overrides:
beginin classorg.apache.jena.sparql.core.DatasetGraphWrapper
-
begin
public void begin(org.apache.jena.query.ReadWrite readWrite) - Specified by:
beginin interfaceorg.apache.jena.sparql.core.Transactional- Overrides:
beginin classorg.apache.jena.sparql.core.DatasetGraphWrapper
-
commit
public void commit()- Specified by:
commitin interfaceorg.apache.jena.sparql.core.Transactional- Overrides:
commitin classorg.apache.jena.sparql.core.DatasetGraphWrapper
-
abort
public void abort()- Specified by:
abortin interfaceorg.apache.jena.sparql.core.Transactional- Overrides:
abortin classorg.apache.jena.sparql.core.DatasetGraphWrapper
-
end
public void end()- Specified by:
endin interfaceorg.apache.jena.sparql.core.Transactional- Overrides:
endin classorg.apache.jena.sparql.core.DatasetGraphWrapper
-
startReadOnlyDatabase
public void startReadOnlyDatabase()Block until no writers or promote transactions present are present.- Specified by:
startReadOnlyDatabasein interfaceorg.apache.jena.dboe.transaction.txn.TransactionalSystemControl
-
finishReadOnlyDatabase
public void finishReadOnlyDatabase()Release any waiting potential writers.- Specified by:
finishReadOnlyDatabasein interfaceorg.apache.jena.dboe.transaction.txn.TransactionalSystemControl
-
startNonExclusiveMode
public void startNonExclusiveMode()- Specified by:
startNonExclusiveModein interfaceorg.apache.jena.dboe.transaction.txn.TransactionalSystemControl
-
tryNonExclusiveMode
public boolean tryNonExclusiveMode(boolean canBlock) - Specified by:
tryNonExclusiveModein interfaceorg.apache.jena.dboe.transaction.txn.TransactionalSystemControl
-
finishNonExclusiveMode
public void finishNonExclusiveMode()- Specified by:
finishNonExclusiveModein interfaceorg.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) withfinishExclusiveMode().Do not call inside an existing transaction.
- Specified by:
startExclusiveModein interfaceorg.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) withfinishExclusiveMode().Do not call inside an existing transaction.
- Specified by:
tryExclusiveModein interfaceorg.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) withfinishExclusiveMode().Do not call inside an existing transaction.
- Specified by:
tryExclusiveModein interfaceorg.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 earlierstartExclusiveMode().- Specified by:
finishExclusiveModein interfaceorg.apache.jena.dboe.transaction.txn.TransactionalSystemControl
-