java-rest-binding
java-rest-binding copied to clipboard
RuntimeException is thrown when calling getOrCreateNode in batch mode
The following code segment works fine if calling from RestAPI directly.
RestNode userNode = restApi.getOrCreateNode(restApi.index().forNodes("user-id"),
"user-id", userId, null);
if (userNode != null){
logger.debug("user node " + userNode.getId() + " is created.");
}
However if running in a batch mode, I got RuntimeException:
public BatchRestResult recordBatch(RestAPI restApi) {
BatchRestResult result = new BatchRestResult();
RestNode userNode = restApi.getOrCreateNode(restApi.index().forNodes("user-id"),
"user-id", user.getUserId(), null);
java.lang.RuntimeException: Error retrieving or creating node for key user-id and value +972548172847 with index user-id
at org.neo4j.rest.graphdb.ExecutingRestAPI.getOrCreateNode(ExecutingRestAPI.java:448)
at org.neo4j.rest.graphdb.RestAPIFacade.getOrCreateNode(RestAPIFacade.java:223)