Search in sources :

Example 1 with IteratorTxnTracker

use of org.apache.jena.dboe.transaction.txn.IteratorTxnTracker in project jena by apache.

the class DatasetGraphStorage method isolate.

private <T> Iterator<T> isolate(Iterator<T> iterator) {
    if (txn.isInTransaction() && txn instanceof TransactionalSystem) {
        // Needs TxnId to track.
        TransactionalSystem txnSystem = (TransactionalSystem) txn;
        TxnId txnId = txnSystem.getThreadTransaction().getTxnId();
        // Add transaction protection.
        return new IteratorTxnTracker<>(iterator, txnSystem, txnId);
    }
    return Iter.iterator(iterator);
}
Also used : TxnId(org.apache.jena.dboe.transaction.txn.TxnId) TransactionalSystem(org.apache.jena.dboe.transaction.txn.TransactionalSystem) IteratorTxnTracker(org.apache.jena.dboe.transaction.txn.IteratorTxnTracker)

Aggregations

IteratorTxnTracker (org.apache.jena.dboe.transaction.txn.IteratorTxnTracker)1 TransactionalSystem (org.apache.jena.dboe.transaction.txn.TransactionalSystem)1 TxnId (org.apache.jena.dboe.transaction.txn.TxnId)1