Skip to content

Synchronous streaming batched cursor throws exception when attempting to close after last batch is consumed #528

Closed
@philipp-birkl

Description

@philipp-birkl

An com.arangodb.ArangoDBException is thrown when trying to close a streaming batched cursor.

Such as

        try(ArangoCursor<Map> cursor = db.query("FOR el in collection RETURN el",
            Map.class,
            new AqlQueryOptions()
                .ttl(3600)
                .batchSize(2)
                .stream(true))) {

            while(cursor.hasNext()) {
                log.info("{}", cursor.next());
            }
        } catch (IOException e) {
            throw new RuntimeException(e);
        }

This code throws an error when closing the cursor after the try-with-resources block is finished.

com.arangodb.ArangoDBException: Response: 404, Error: 1600 - cursor not found
	at com.arangodb.ArangoDBException.of(ArangoDBException.java:137)
	at com.arangodb.ArangoDBException.of(ArangoDBException.java:111)
	at com.arangodb.ArangoDBException.of(ArangoDBException.java:107)
	at com.arangodb.internal.net.CommunicationProtocol.execute(CommunicationProtocol.java:43)
	at com.arangodb.internal.ArangoExecutorSync.execute(ArangoExecutorSync.java:55)
	at com.arangodb.internal.ArangoExecutorSync.execute(ArangoExecutorSync.java:43)
	at com.arangodb.internal.ArangoDatabaseImpl$1.close(ArangoDatabaseImpl.java:216)
	at com.arangodb.internal.cursor.ArangoCursorImpl.close(ArangoCursorImpl.java:60)
Product Version
Spring Boot 3.2.0
ArangoDB 3.11
Arango Java Driver 7.3.0

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions