Neo4j java.rmi.UnmarshalException:解组返回标头时出错;嵌套的异常是:

时间:2018-07-30 09:23:40

标签: neo4j graph-databases bulkupdate

    neo4j-sh (?)$ MATCH (n:toy) - [rel:`buy_vendor`] -> (vc)
    WITH rel,n
    SET rel.mt=n.buy_type;

    java.rmi.UnmarshalException: Error unmarshaling return header; nested exception is: 
            java.io.EOFException
            at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:236)
            at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:161)
            at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(RemoteObjectInvocationHandler.java:227)
            at java.rmi.server.RemoteObjectInvocationHandler.invoke(RemoteObjectInvocationHandler.java:179)
            at com.sun.proxy.$Proxy1.interpretLine(Unknown Source)
            at org.neo4j.shell.impl.AbstractClient.evaluate(AbstractClient.java:147)
            at org.neo4j.shell.impl.AbstractClient.evaluate(AbstractClient.java:131)
            at org.neo4j.shell.impl.AbstractClient.grabPrompt(AbstractClient.java:99)
            at org.neo4j.shell.StartClient.grabPromptOrJustExecuteCommand(StartClient.java:412)
            at org.neo4j.shell.StartClient.startRemote(StartClient.java:359)
            at org.neo4j.shell.StartClient.start(StartClient.java:229)
            at org.neo4j.shell.StartClient.main(StartClient.java:147)
    Caused by: java.io.EOFException
            at java.io.DataInputStream.readByte(DataInputStream.java:267)
            at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:222)
            ... 11 more
    neo4j-sh (?)$

我正在尝试更新超过100万条记录。有没有一种方法可以批量更新。有没有更好的方法来查询数据库并更新属性的关系。

2 个答案:

答案 0 :(得分:0)

可能是加载文件中没有所引用的列名... 检查列名...疯狂猜测..

答案 1 :(得分:0)

使用apoc.periodic一次更新大量节点。

CALL apoc.periodic.commit("
  MATCH (n:toy) - [rel:buy_vendor] -> ()
  WITH rel,n
  SET rel.mt=n.buy_type;
RETURN count(*)
", { limit : 50000});

您应该首先将apoc jar添加到Neo4j插件

希望这对您有所帮助!