File tree Expand file tree Collapse file tree
base/src/main/java/org/eclipse/rdf4j/sail
lmdb/src/main/java/org/eclipse/rdf4j/sail/lmdb Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -48,9 +48,6 @@ public boolean hasNext() throws QueryEvaluationException {
4848 } catch (QueryEvaluationException e ) {
4949 throw e ;
5050 } catch (Exception e ) {
51- if (e instanceof InterruptedException ) {
52- Thread .currentThread ().interrupt ();
53- }
5451 throw new QueryEvaluationException (e );
5552 }
5653 }
@@ -75,9 +72,6 @@ public T next() throws QueryEvaluationException {
7572 } catch (IllegalStateException | QueryEvaluationException e ) {
7673 throw e ;
7774 } catch (Exception e ) {
78- if (e instanceof InterruptedException ) {
79- Thread .currentThread ().interrupt ();
80- }
8175 throw new QueryEvaluationException (e );
8276 }
8377 }
Original file line number Diff line number Diff line change 2424
2525import java .io .IOException ;
2626import java .nio .ByteBuffer ;
27+ import java .util .NoSuchElementException ;
2728import java .util .concurrent .locks .StampedLock ;
2829
2930import org .eclipse .rdf4j .sail .SailException ;
3334import org .lwjgl .PointerBuffer ;
3435import org .lwjgl .system .MemoryStack ;
3536import org .lwjgl .util .lmdb .MDBVal ;
37+ import org .slf4j .Logger ;
38+ import org .slf4j .LoggerFactory ;
3639
3740/**
3841 * A record iterator that wraps a native LMDB iterator.
3942 */
4043class LmdbRecordIterator implements RecordIterator {
44+ private static final Logger log = LoggerFactory .getLogger (LmdbRecordIterator .class );
4145 private final Pool pool ;
4246
4347 private final TripleIndex index ;
@@ -126,6 +130,11 @@ class LmdbRecordIterator implements RecordIterator {
126130 public long [] next () {
127131 long stamp = txnLock .readLock ();
128132 try {
133+ if (closed ) {
134+ log .debug ("Calling next() on an LmdbRecordIterator that is already closed, returning null" );
135+ return null ;
136+ }
137+
129138 if (txnRefVersion != txnRef .version ()) {
130139 // cursor must be renewed
131140 mdb_cursor_renew (txn , cursor );
You can’t perform that action at this time.
0 commit comments