java.lang.Object
org.apache.jena.tdb1.transaction.TransactionManager
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final booleanstatic intThis controls how large to let the journal get in size before deciding to flush even if below the queue batch size.static intThis controls how large to let the journal in comitted transactions before deciding to pause and flush as soon as possible.static intThis controls how many write transactions we batch up before deciding to try to flush the journal to the main database. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanvoidaddAdditionComponent(TransactionLifecycle txnLifecycle) Add aTransactionLifecycleto transactions createed from this point onwards.voidBlock until no writers are active.voidClear all recording state - does not clear statsvoidvoidAllow writers.voidReturn to normal (release waiting transactions, allow new transactions).voidflush()Try to flush the delayed write queue - only happens if there are no active transactionslonglongReturn the exclusivity lock.longbooleanGet recording statevoidrecording(boolean flag) Set recording on or offvoidEnter exclusive mode.state()booleanBlock until no writers are active or, optionally, return if can't at the moment.booleanTry to enter exclusive mode.
-
Field Details
-
QueueBatchSize
public static int QueueBatchSizeThis controls how many write transactions we batch up before deciding to try to flush the journal to the main database. -
JournalThresholdSize
public static int JournalThresholdSizeThis controls how large to let the journal get in size before deciding to flush even if below the queue batch size. -1 means "off". -
MaxQueueThreshold
public static int MaxQueueThresholdThis controls how large to let the journal in comitted transactions before deciding to pause and flush as soon as possible. -1 means "off". -
DEBUG
public static final boolean DEBUG- See Also:
-
-
Constructor Details
-
TransactionManager
-
-
Method Details
-
activeTransactions
public boolean activeTransactions() -
getCountActiveReaders
public long getCountActiveReaders() -
getCountActiveWriters
public long getCountActiveWriters() -
getQueueLength
public long getQueueLength() -
closedown
public void closedown() -
addAdditionComponent
Add aTransactionLifecycleto transactions createed from this point onwards. -
begin
-
blockWriters
public void blockWriters()Block until no writers are active. When this returns, it guarantees that the database is not changing and the journal is flush to disk.The application must call
enableWriters()later.This operation must not be nested (it will block).
- See Also:
-
tryBlockWriters
public boolean tryBlockWriters()Block until no writers are active or, optionally, return if can't at the moment. Return 'true' if the operation succeeded.If it returns true, the application must call
enableWriters()later.- See Also:
-
enableWriters
public void enableWriters()Allow writers. This must be used in conjunction withblockWriters()ortryBlockWriters()- See Also:
-
startExclusiveMode
public void startExclusiveMode()Enter exclusive mode.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().The caller must not be inside a transaction associated with this TransactionManager. (The call will block waiting for that transaction to finish.)
-
tryExclusiveMode
public boolean tryExclusiveMode()Try to enter exclusive mode. If return is true, then are no active transactions on return and new transactions will be held up in 'begin'. If false, there is an in-progress transactions. Return to normal (release waiting transactions, allow new transactions) withfinishExclusiveMode().The call must not itself be in a transaction (this call will return false).
-
getExclusivityLock$
Return the exclusivity lock. Testing and internal use only. -
finishExclusiveMode
public void finishExclusiveMode()Return to normal (release waiting transactions, allow new transactions). Must be paired with an earlierstartExclusiveMode(). -
flush
public void flush()Try to flush the delayed write queue - only happens if there are no active transactions -
recording
public boolean recording()Get recording state -
recording
public void recording(boolean flag) Set recording on or off -
clearRecordingState
public void clearRecordingState()Clear all recording state - does not clear stats -
getJournal
-
state
-