Package org.apache.jena.system
Class TxnOp
- java.lang.Object
-
- org.apache.jena.system.TxnOp
-
public class TxnOp extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description TxnOp()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidcompatibleWithPromote(TxnType requestedTxnType, Transactional currentTxn)Check an existingTransactionalfor compatibility with aTxnTypeand promote theTransactionalif necessary.static booleanisTxnTypeCompatible(TxnType innerTxnType, TxnType outerTxnType)Check whether aTxnTypeis compatible with another.static voidtxnTypeCompatibleEx(TxnType innerTxnType, TxnType outerTxnType)Check whether aTxnTypeis compatible with another.
-
-
-
Method Detail
-
txnTypeCompatibleEx
public static void txnTypeCompatibleEx(TxnType innerTxnType, TxnType outerTxnType)
Check whether aTxnTypeis compatible with another. Typically the "inner" transaction is a requested new transaction and the outer one an existing transaction. Throw an exception if not compatible.- Parameters:
innerTxnType-outerTxnType-- Throws:
JenaTransactionException- See Also:
isTxnTypeCompatible(org.apache.jena.query.TxnType, org.apache.jena.query.TxnType),compatibleWithPromote(org.apache.jena.query.TxnType, org.apache.jena.sparql.core.Transactional)
-
isTxnTypeCompatible
public static boolean isTxnTypeCompatible(TxnType innerTxnType, TxnType outerTxnType)
Check whether aTxnTypeis compatible with another. Typically then "inner" transaction is a requested new transaction and the outer one an existing transaction. A TxnType is compatible with (can run inside) another TxnType (for an an existing or outer transaction) if: the outer one covers the needs of the inner one
READ < PROMOTE (either) < WRITE < no outer In particular: Inner is READ works with any outer. Outer is WRITE works with any inner. For promoting if necessary, seecompatibleWithPromote(org.apache.jena.query.TxnType, org.apache.jena.sparql.core.Transactional)- Parameters:
innerTxnType-outerTxnType-
-
compatibleWithPromote
public static void compatibleWithPromote(TxnType requestedTxnType, Transactional currentTxn)
Check an existingTransactionalfor compatibility with aTxnTypeand promote theTransactionalif necessary. TheTransactionaldoes not need to already be in a transaction. Throw aJenaTransactionExceptionif not compatible (e.g. current READ, requesting a WRITE).- Parameters:
requestedTxnType-currentTxn-- Throws:
JenaTransactionException- if not possible.
-
-