Note that there are some explanatory texts on larger screens.

plurals
  1. POBatch cypher queries generated by RestCypherQueryEngine
    text
    copied!<p>I am trying to batch together a few cypher queries with the REST API (using the java bindings library) so that only one call is made over the wire. But it seems to not respect the batching on the client side and gives this error:</p> <pre><code>java.lang.RuntimeException: Error reading as JSON '' at org.neo4j.rest.graphdb.util.JsonHelper.readJson(JsonHelper.java:57) at org.neo4j.rest.graphdb.util.JsonHelper.jsonToSingleValue(JsonHelper.java:62) at org.neo4j.rest.graphdb.RequestResult.toEntity(RequestResult.java:114) at org.neo4j.rest.graphdb.RequestResult.toMap(RequestResult.java:123) at org.neo4j.rest.graphdb.batch.RecordingRestRequest.toMap(RecordingRestRequest.java:138) at org.neo4j.rest.graphdb.ExecutingRestAPI.query(ExecutingRestAPI.java:489) at org.neo4j.rest.graphdb.ExecutingRestAPI.query(ExecutingRestAPI.java:509) at org.neo4j.rest.graphdb.RestAPIFacade.query(RestAPIFacade.java:233) at org.neo4j.rest.graphdb.query.RestCypherQueryEngine.query(RestCypherQueryEngine.java:50) ... Caused by: java.io.EOFException: No content to map to Object due to end of input at org.codehaus.jackson.map.ObjectMapper._initForReading(ObjectMapper.java:2766) at org.codehaus.jackson.map.ObjectMapper._readMapAndClose(ObjectMapper.java:2709) at org.codehaus.jackson.map.ObjectMapper.readValue(ObjectMapper.java:1854) at org.neo4j.rest.graphdb.util.JsonHelper.readJson(JsonHelper.java:55) ... 41 more </code></pre> <p>This is how I am trying to batch them:</p> <pre><code>graphDatabaseService.getRestAPI().executeBatch(new BatchCallback&lt;Void&gt;() { @Override public Void recordBatch(RestAPI batchRestApi) { String query = "CREATE accounts=({userId:{userId}})-[r:OWNS]-&gt;({facebookId:{facebookId}})"; graphDatabaseService.getQueryEngine().query(query, map("userId", 1, "facebookId", "1")); graphDatabaseService.getQueryEngine().query(query, map("userId", 2, "facebookId", "2")); graphDatabaseService.getQueryEngine().query(query, map("userId", 3, "facebookId", "3")); return null; } }); </code></pre> <p>I am using noe4j version 1.9 and the corresponding client library. Should this be possible?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload