Skip to content

[DE-739] fix closing AQL cursor #534

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,9 @@ public <T> ArangoCursor<T> cursor(final String cursorId, final Class<T> type, fi
private <T> ArangoCursor<T> createCursor(
final CursorEntity<T> result,
final Class<T> type,
final AqlQueryOptions options,
final AqlQueryOptions opts,
final HostHandle hostHandle) {
AqlQueryOptions options = opts != null ? opts : new AqlQueryOptions();

final ArangoCursorExecute<T> execute = new ArangoCursorExecute<T>() {
@Override
Expand All @@ -223,8 +224,7 @@ public void close(final String id) {
}
}
};

return new ArangoCursorImpl<>(execute, type, result);
return new ArangoCursorImpl<>(execute, type, result, options.getAllowRetry());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ public class ArangoCursorImpl<T> implements ArangoCursor<T> {
private final boolean allowRetry;

public ArangoCursorImpl(final ArangoCursorExecute<T> execute,
final Class<T> type, final CursorEntity<T> result) {
final Class<T> type, final CursorEntity<T> result, final Boolean allowRetry) {
super();
this.execute = execute;
this.type = type;
id = result.getId();
pontentialDirtyRead = result.isPotentialDirtyRead();
iterator = new ArangoCursorIterator<>(id, execute, result);
this.allowRetry = result.getNextBatchId() != null;
this.allowRetry = Boolean.TRUE.equals(allowRetry);
}

@Override
Expand Down