I am writing a Windows console application in C# that is supposed to import 15k nodes from an XML file and build a graph database in Neo4j (2.0.0) using the neo4jclient. At the very beginning of the app, I am trying to remove all nodes and relationships from the database so that at every run of the application the database is fresh and clean:
Console.WriteLine("Deleting nodes and relationships...");
graphClient.Cypher.OptionalMatch("n-[r]-()").Delete("r").ExecuteWithoutResults();
graphClient.Cypher.Match("n").Delete("n").ExecuteWithoutResults();
Console.WriteLine("...done!");
At the moment the database has about 16k nodes (with no relationships between them) which were created by a couple of previous run of the application itself. When the second Delete statement above runs, this exception is thrown after 30 or so second:
Unhandled Exception: System.AggregateException: One or more errors occurred. ---> System.Threading.Tasks.TaskCanceledException: A task was canceled.
--- End of inner exception stack trace ---
at Neo4jClient.GraphClient.SendHttpRequest(HttpRequestMessage request, String commandDescription, HttpStatusCode[] expectedStatusCodes) in c:\TeamCity\buildAgent\work\5bae2aa9bce99f44\Neo4jClient\GraphClient.cs:line 138
at Neo4jClient.GraphClient.Neo4jClient.IRawGraphClient.ExecuteCypher(CypherQuery query) in c:\TeamCity\buildAgent\work\5bae2aa9bce99f44\Neo4jClient\GraphClient.cs:line 843
at Neo4jClient.Cypher.CypherFluentQuery.ExecuteWithoutResults() in c:\TeamCity\buildAgent\work\5bae2aa9bce99f44\Neo4jClient\Cypher\CypherFluentQuery.cs:line 322
at Xml2Cypher.Program.Main(String[] args) in c:\_PrivateProjects\KanjiDoc2Neo4J\Xml2Cypher\Program.cs:line 25
I also tried batching the delete statements using a Limit statement, but I get the same exception. Any ideas? I think the Request is timing out, but even batching doesn't seem to solve the issue.
graphClient.Cypher.Match("n").With("n").Limit(100).Delete("n").ExecuteWithoutResults();
I tried running the following statement from the browser:
match (n:Characters) with n limit 100 delete n
but even there I get an "unknown error".