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);
}
Aggregations