neo4j/community — Issue #302: Error on batch when adding a relationship referencing a unique node previously created
Author: simosug
Created: 2012-03-02 09:58:55+00:00
State: open

Using cypher notation the data scenario can be summarized as follows:
n(0) - has -> Cultures(ID=fra)
* index Cultures contains unique node x with ID=fra
* root has outgoing relationship "has" to x

Now, if I put this in a 2 batch operations we have:
[{
"method" : "POST",
"to" : "/index/node/Cultures?unique",
"body" : {
"key" : "ID",
"value" : "fra",
"properties" : {
"ID" : "fra"
}
},
"id" : 0
}, {
"method" : "POST",
"to" : "/node/0",
"body" : {
"to" : "{0}/relationships",
"type" : "has",
},
"id" : 1
}
]

Executed in Poster plugin this json returns error 500:
{
"message" : "",
"exception" :
"org.neo4j.server.rest.domain.BatchOperationFailedException: ",
"stacktrace" :
[ "org.neo4j.server.rest.web.BatchOperationService.performJob(BatchOperationService.java:
170)",
"org.neo4j.server.rest.web.BatchOperationService.performBatchOperations(BatchOperationService.java:
122)", ...

Operation with id=0 alone executes successfully and I fail to see
syntax errors in operation1.
Possible workaround: create regular node (op0), create relationship
(op1) and add unique node to index (op2).

Peter says it's a legit bug.
Full description available here: http://groups.google.com/group/neo4j/browse_thread/thread/bd4a646332b7ffbe