Skip to content

importDocuments throws VPackValueTypeException: Expecting type ARRAY in silent mode #241

Closed
@grzegorz-aniol

Description

@grzegorz-aniol

arangodb-java-driver version: 5.0.3

arangodb version: 3.4.0-rc.5

There is an exception while batch insert of documents when silent mode is used:

List<BaseDocument> docs = ...
...
DocumentCreateOptions docCreateOpts = new DocumentCreateOptions()
        .silent(true)
        .overwrite(overwrite)
        .returnNew(false)
        .returnOld(false);

db.collection("collection").importDocuments(docs, docCreateOpts);
com.arangodb.ArangoDBException: com.arangodb.velocypack.exception.VPackValueTypeException: Expecting type ARRAY
	at com.arangodb.internal.ArangoExecutorSync.execute(ArangoExecutorSync.java:74)
	at com.arangodb.internal.ArangoExecutorSync.execute(ArangoExecutorSync.java:63)
	at com.arangodb.internal.ArangoCollectionImpl.insertDocuments(ArangoCollectionImpl.java:97)

The possible solution is to omit proceeding multidocument response body in method:
com.arangodb.internal.InternalArangoCollection#insertDocumentsResponseDeserializer :

  ...
  final VPackSlice body = response.getBody();
  if (body.isArray()) {
    for (final Iterator<VPackSlice> iterator = body.arrayIterator(); iterator.hasNext();) {
    ..
    }
  }
  ...

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions