client.ExecuteWithoutResults()上的聚合异常

时间:2014-08-04 12:21:04

标签: neo4j neo4jclient

我尝试使用一个参数化的Cypher创建请求创建许多(在本例中为大约25000个)节点。在大约30秒后执行此操作时,会抛出System.AggregateException。 我不知道如何避免以及如何解决这个问题。

public void createFiles(File[] files)
{
    client.Cypher
          .Create("(file:FILE {newFiles})")
          .WithParam("newFiles", files)
          .ExecuteWithoutResults();
}

File[] files是一个对象数组,大约有25.000个对象,每个对象有6个字符串属性。

我尝试将数组拆分为较小的数组(每1000个对象)并通过它们进行预处理,但也会抛出System.AggregateException

如下例外:

    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 ...Neo4jClient\
raphClient.cs:line 138
   at Neo4jClient.GraphClient.Neo4jClient.IRawGraphClient.ExecuteCypher(CypherQuery query) in ...\Neo4jClient\GraphClient.cs:line 843
   at Neo4jClient.Cypher.CypherFluentQuery.ExecuteWithoutResults() in ...\Neo4jClient\Cypher\CypherFluentQuery.cs:line 322
   at FileSystemSizeAnalyser.Database.createFolders(File[] files) in ...\FileSystemSiz
Analyser\Database.cs:line 65
---> (Inner Exception #0) System.Threading.Tasks.TaskCanceledException: A task was canceled.<---

任何建议在哪里查看以及如何避免此异常?此外,有没有办法重新发送请求,直到它成功?

on Neo4jClient 1.0.0.656

0 个答案:

没有答案