I am playing around with the new async driver.
I am reading in a multitude of paths(together with their parent path) from a directory structure. And want to represent it in neo4j using nodes (:Directory {uncPath:$path}). And they should all be connected to each other via [:HAS_CHILD_DIRECTORY].
I am opening a single AsyncSession and then write the transactions in parallel using a Parallel.ForEach. So the order of the paths is random.
This is my cypher code:
"merge
(current:Directory {uncPath:$Path})
merge
(parent:Directory {uncPath:$ParentPath})
merge
(parent)-[:HAS_CHILD_DIRECTORY]->(current)"
I get exceptions on some of the IResultCursor.ConsumeAsync() calls with the following stacktrace:
System.ArgumentNullException: Value cannot be null. (Parameter '_connection')
at Neo4j.Driver.Internal.Throw.ArgumentNullException.If(Func`1 func, String paramName)
at Neo4j.Driver.Internal.Throw.ArgumentNullException.IfNull(Object parameter, String paramName)
at Neo4j.Driver.Internal.AsyncSession.OnResultConsumedAsync()
at Neo4j.Driver.Internal.Result.ResultCursorBuilder.<>c__DisplayClass28_0.<b__0>d.MoveNext()
Some nodes end up not having a HAS_CHILD_DIRECTORY relationship to their parent.