java.lang.Object
org.apache.jena.system.ThreadTxn
An action that will happen on a different thread later when
ThreadAction.run() is
called. A thread is created and the transaction started during a call to the
creation operations threadTxnRead(org.apache.jena.sparql.core.Transactional, java.lang.Runnable) or threadTxnWrite(org.apache.jena.sparql.core.Transactional, java.lang.Runnable).
The associated Runnable is called and the transaction completed when
ThreadAction.run() is called. Being on a thread, the state of the world the
forked transaction sees is outside the creating thread which may itself be in a
transaction. Warning: creating a write transaction inside a write transaction
will cause deadlock.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ThreadActionthreadTxn(Transactional trans, TxnType txnType, Runnable action) Create a thread-backed delayed transaction action.static ThreadActionthreadTxnRead(Transactional trans, Runnable action) Create a thread-backed delayed READ transaction action.static ThreadActionthreadTxnWrite(Transactional trans, Runnable action) Create a thread-backed delayed WRITE action.static ThreadActionthreadTxnWriteAbort(Transactional trans, Runnable action) Create a thread-backed delayed WRITE-abort action (mainly for testing).
-
Constructor Details
-
ThreadTxn
public ThreadTxn()
-
-
Method Details
-
threadTxn
Create a thread-backed delayed transaction action. CallThreadAction.run()to perform the read transaction. -
threadTxnRead
Create a thread-backed delayed READ transaction action. CallThreadAction.run()to perform the read transaction. -
threadTxnWrite
Create a thread-backed delayed WRITE action. CallThreadAction.run()to perform the write transaction. (If called from inside a write transaction on thetrans, this will deadlock.) -
threadTxnWriteAbort
Create a thread-backed delayed WRITE-abort action (mainly for testing).
-