Neo4j Enterprise 3.4.5, using a custom procedure to clone a subgraph.
MATCH (ir_i:Insight { uuid: "2bba4e25-2bd1-11e9-8948-2ab0e8a6a76e" })
CALL uvs.cloneTree(ir_i, ["Point"], []) YIELD out
WITH out AS ir_i
OPTIONAL MATCH (ir_i)-[ir_T:TITLED]->(ir_mdT:MessageDefinition)
OPTIONAL MATCH (ir_i)-[ir_S:STATES]->(ir_mdS:MessageDefinition)
OPTIONAL MATCH (ir_i)-[ir_AT:AT]->(pt_p:Point)
OPTIONAL MATCH (pt_p)-[pt_A:ALONG]->(pt_a:Axis)
RETURN *
This works just fine in the Neo4j browser, and I see the properly cloned tree. But in my SDN-driven API, this results in:
Error is org.springframework.core.codec.EncodingException: JSON encoding error: Infinite recursion (StackOverflowError); nested exception is com.fasterxml.jackson.databind.JsonMappingException:
Infinite recursion (StackOverflowError) (through reference chain:
social.unveil.api.core.domain.Point["along"]->java.util.ArrayList[0]->
social.unveil.api.core.domain.PointAlong["point"]->social.unveil.api.core.domain.Point["along"]->
java.util.ArrayList[0]->social.unveil.api.core.domain.PointAlong["point"]->
social.unveil.api.core.domain.Point["along"]->java.util.ArrayList[0]->
social.unveil.api.core.domain.PointAlong["point"]->social.unveil.api.core.domain.Point["along"]
...
Now, the out
value is just a node; the head of the cloned tree. If I request the cloned tree in a different GET request, it serializes fine. Nor does it help to simply re-MATCH the cloned root node before returning it. Other than the clone operation, this Cypher is identical to that used in any other place this entity is fetched.
This is not the only case where I use a node that's been modified by a procedure, but it's the only case where it's returning a graph that was created in the current transaction. Could that be part of the issue?
Sorry, this isn't a lot to go on, but any thoughts are appreciated.