Package org.apache.jena.system
Class ThreadTxn
- java.lang.Object
-
- org.apache.jena.system.ThreadTxn
-
public class ThreadTxn extends java.lang.ObjectAn action that will happen on a different thread later whenThreadAction.run()is called. A thread is created and the transaction started during a call to the creation operationsthreadTxnRead(org.apache.jena.sparql.core.Transactional, java.lang.Runnable)orthreadTxnWrite(org.apache.jena.sparql.core.Transactional, java.lang.Runnable). The associated Runnable is called and the transaction completed whenThreadAction.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 Constructor Description ThreadTxn()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ThreadActionthreadTxn(Transactional trans, TxnType txnType, java.lang.Runnable action)Create a thread-backed delayed transaction action.static ThreadActionthreadTxnRead(Transactional trans, java.lang.Runnable action)Create a thread-backed delayed READ transaction action.static ThreadActionthreadTxnWrite(Transactional trans, java.lang.Runnable action)Create a thread-backed delayed WRITE action.static ThreadActionthreadTxnWriteAbort(Transactional trans, java.lang.Runnable action)Create a thread-backed delayed WRITE-abort action (mainly for testing).
-
-
-
Method Detail
-
threadTxn
public static ThreadAction threadTxn(Transactional trans, TxnType txnType, java.lang.Runnable action)
Create a thread-backed delayed transaction action. CallThreadAction.run()to perform the read transaction.
-
threadTxnRead
public static ThreadAction threadTxnRead(Transactional trans, java.lang.Runnable action)
Create a thread-backed delayed READ transaction action. CallThreadAction.run()to perform the read transaction.
-
threadTxnWrite
public static ThreadAction threadTxnWrite(Transactional trans, java.lang.Runnable action)
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
public static ThreadAction threadTxnWriteAbort(Transactional trans, java.lang.Runnable action)
Create a thread-backed delayed WRITE-abort action (mainly for testing).
-
-