在Neo4j 2.2.3错误中更新查询

时间:2015-07-20 06:27:08

标签: neo4j

我们有一个更新关系道具的查询:

MATCH (body_id:BodyId{body_id : 126414})<-[to_body_id:TO_BODY_ID{end : 99999999999999}]-(body:Body)
  -[body_to_target:BODY_TO_TARGET{end : 99999999999999}]-(target:Target)
  -[to_target_id:TO_TARGET_ID{end : 99999999999999}]->(target_id:TargetId{target_id : 126414}) 
WHERE ((id(body) = 28888220)) 
with body_to_target 
SET body_to_target.start = 1434535407147

有时我们会收到此错误:

  

Neo.DatabaseError.Statement.ExecutionFailure:java.lang.Long不能   强制转换为org.neo4j.index.impl.lucene.RelationshipId

从Java运行时的一个堆栈:

Caused by: java.lang.RuntimeException: Error executing cypher statement(s) [{code=Neo.DatabaseError.Statement.ExecutionFailure, message=java.lang.Long cannot be cast to org.neo4j.index.impl.lucene.RelationshipId, stackTrace=java.lang.ClassCastException: java.lang.Long cannot be cast to org.neo4j.index.impl.lucene.RelationshipId
at org.neo4j.index.impl.lucene.RelationshipId.equals(RelationshipId.java:43)
at java.util.HashMap.removeNode(HashMap.java:819)
at java.util.HashMap.remove(HashMap.java:798)
at java.util.HashSet.remove(HashSet.java:235)
at org.neo4j.index.impl.lucene.ExactTxData.remove(ExactTxData.java:158)
at org.neo4j.index.impl.lucene.TxDataHolder.remove(TxDataHolder.java:48)
at org.neo4j.index.impl.lucene.LuceneTransactionState.insert(LuceneTransactionState.java:86)
at org.neo4j.index.impl.lucene.LuceneTransactionState.add(LuceneTransactionState.java:41)
at org.neo4j.index.impl.lucene.LuceneIndex$RelationshipIndex.addRelationship(LuceneIndex.java:452)
at org.neo4j.kernel.impl.api.StateHandlingStatementOperations$3.visit(StateHandlingStatementOperations.java:1379)
at org.neo4j.kernel.impl.api.store.CacheLayer.relationshipVisit(CacheLayer.java:489)
at org.neo4j.kernel.impl.api.StateHandlingStatementOperations.relationshipVisit(StateHandlingStatementOperations.java:1238)
at org.neo4j.kernel.impl.api.StateHandlingStatementOperations.relationshipAddToLegacyIndex(StateHandlingStatementOperations.java:1373)
at org.neo4j.kernel.impl.api.OperationsFacade.relationshipAddToLegacyIndex(OperationsFacade.java:881)
at org.neo4j.kernel.impl.coreapi.LegacyIndexProxy$Type$2.add(LegacyIndexProxy.java:169)
at org.neo4j.kernel.impl.coreapi.LegacyIndexProxy.internalAdd(LegacyIndexProxy.java:517)
at org.neo4j.kernel.impl.coreapi.LegacyIndexProxy.add(LegacyIndexProxy.java:383)
at org.neo4j.kernel.impl.coreapi.AbstractAutoIndexerImpl.propertyChanged(AbstractAutoIndexerImpl.java:70)
at org.neo4j.kernel.impl.api.LegacyPropertyTrackers.relationshipChangeStoreProperty(LegacyPropertyTrackers.java:98)
at org.neo4j.kernel.impl.api.StateHandlingStatementOperations.relationshipSetProperty(StateHandlingStatementOperations.java:648)
at org.neo4j.kernel.impl.api.ConstraintEnforcingEntityOperations.relationshipSetProperty(ConstraintEnforcingEntityOperations.java:171)
at org.neo4j.kernel.impl.api.LockingStatementOperations.relationshipSetProperty(LockingStatementOperations.java:340)
at org.neo4j.kernel.impl.api.OperationsFacade.relationshipSetProperty(OperationsFacade.java:665)
at org.neo4j.cypher.internal.spi.v2_2.TransactionBoundQueryContext$RelationshipOperations.setProperty(TransactionBoundQueryContext.scala:216)
at org.neo4j.cypher.internal.compiler.v2_2.spi.DelegatingOperations.setProperty(DelegatingQueryContext.scala:126)
at org.neo4j.cypher.internal.compatibility.ExceptionTranslatingQueryContext$ExceptionTranslatingOperations.org$neo4j$cypher$internal$compatibility$ExceptionTranslatingQueryContext$ExceptionTranslatingOperations$$super$setProperty(ExceptionTranslatingQueryContext.scala:151)
at org.neo4j.cypher.internal.compatibility.ExceptionTranslatingQueryContext$ExceptionTranslatingOperations$$anonfun$setProperty$1.apply$mcV$sp(ExceptionTranslatingQueryContext.scala:151)
at org.neo4j.cypher.internal.compatibility.ExceptionTranslatingQueryContext$ExceptionTranslatingOperations$$anonfun$setProperty$1.apply(ExceptionTranslatingQueryContext.scala:151)
at org.neo4j.cypher.internal.compatibility.ExceptionTranslatingQueryContext$ExceptionTranslatingOperations$$anonfun$setProperty$1.apply(ExceptionTranslatingQueryContext.scala:151)
at org.neo4j.cypher.internal.compatibility.ExceptionTranslatingQueryContext.org$neo4j$cypher$internal$compatibility$ExceptionTranslatingQueryContext$$translateException(ExceptionTranslatingQueryContext.scala:182)
at org.neo4j.cypher.internal.compatibility.ExceptionTranslatingQueryContext$ExceptionTranslatingOperations.setProperty(ExceptionTranslatingQueryContext.scala:151)
at org.neo4j.cypher.internal.compiler.v2_2.spi.UpdateCountingQueryContext$CountingOps.setProperty(UpdateCountingQueryContext.scala:132)
at org.neo4j.cypher.internal.compiler.v2_2.mutation.PropertySetAction.exec(PropertySetAction.scala:52)
at org.neo4j.cypher.internal.compiler.v2_2.pipes.ExecuteUpdateCommandsPipe.org$neo4j$cypher$internal$compiler$v2_2$pipes$ExecuteUpdateCommandsPipe$$exec(ExecuteUpdateCommandsPipe.scala:56)
at org.neo4j.cypher.internal.compiler.v2_2.pipes.ExecuteUpdateCommandsPi$$$$3fd0ddfab96df657454927b510aaae$$$$ands$1$$anonfun$apply$2.apply(ExecuteUpdateCommandsPipe.scala:45)
at org.neo4j.cypher.internal.compiler.v2_2.pipes.ExecuteUpdateCommandsPi$$$$3fd0ddfab96df657454927b510aaae$$$$ands$1$$anonfun$apply$2.apply(ExecuteUpdateCommandsPipe.scala:45)
at scala.collection.Iterator$$anon$13.hasNext(Iterator.scala:371)
at scala.collection.Iterator$$anon$13.hasNext(Iterator.scala:371)
at org.neo4j.cypher.internal.compiler.v2_2.pipes.EmptyResultPipe.internalCreateResults(EmptyResultPipe.scala:29)
at org.neo4j.cypher.internal.compiler.v2_2.pipes.PipeWithSource.createResults(Pipe.scala:122)
at org.neo4j.cypher.internal.compiler.v2_2.executionplan.DefaultExecutionResultBuilderFactory$ExecutionWorkflowBuilder.createResults(DefaultExecutionResultBuilderFactory.scala:92)
at org.neo4j.cypher.internal.compiler.v2_2.executionplan.DefaultExecutionResultBuilderFactory$ExecutionWorkflowBuilder.build(DefaultExecutionResultBuilderFactory.scala:64)
at org.neo4j.cypher.internal.compiler.v2_2.executionplan.ExecutionPlanBuilder$$anonfun$getExecutionPlanFunction$1.apply(ExecutionPlanBuilder.scala:121)
at org.neo4j.cypher.internal.compiler.v2_2.executionplan.ExecutionPlanBuilder$$anonfun$getExecutionPlanFunction$1.apply(ExecutionPlanBuilder.scala:105)
at org.neo4j.cypher.internal.compiler.v2_2.executionplan.ExecutionPlanBuilder$$anon$1.run(ExecutionPlanBuilder.scala:69)
at org.neo4j.cypher.internal.compatibility.CompatibilityFor2_2$ExecutionPlanWrapper$$anonfun$run$1.apply(CompatibilityFor2_2.scala:173)
at org.neo4j.cypher.internal.compatibility.CompatibilityFor2_2$ExecutionPlanWrapper$$anonfun$run$1.apply(CompatibilityFor2_2.scala:173)
at org.neo4j.cypher.internal.compatibility.exceptionHandlerFor2_2$.runSafely(CompatibilityFor2_2.scala:105)
at org.neo4j.cypher.internal.compatibility.CompatibilityFor2_2$ExecutionPlanWrapper.run(CompatibilityFor2_2.scala:172)
at org.neo4j.cypher.internal.PreparedPlanExecution.execute(PreparedPlanExecution.scala:28)
at org.neo4j.cypher.ExecutionEngine.execute(ExecutionEngine.scala:108)
at org.neo4j.cypher.ExecutionEngine.execute(ExecutionEngine.scala:102)
at org.neo4j.cypher.javacompat.internal.ServerExecutionEngine.executeQuery(ServerExecutionEngine.java:61)
at org.neo4j.server.rest.transactional.TransactionHandle.executeStatements(TransactionHandle.java:327)
at org.neo4j.server.rest.transactional.TransactionHandle.execute(TransactionHandle.java:258)
at org.neo4j.server.rest.transactional.TransactionHandle.execute(TransactionHandle.java:103)
at org.neo4j.server.rest.web.TransactionalService$1.write(TransactionalService.java:192)
at com.sun.jersey.core.impl.provider.entity.StreamingOutputProvider.writeTo(StreamingOutputProvider.java:71)
at com.sun.jersey.core.impl.provider.entity.StreamingOutputProvider.writeTo(StreamingOutputProvider.java:57)
at com.sun.jersey.spi.container.ContainerResponse.write(ContainerResponse.java:302)
at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1510)
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1419)
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1409)
at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:409)
at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:540)
at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:715)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:800)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:587)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:221)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1125)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1059)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:52)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
at org.eclipse.jetty.server.Server.handle(Server.java:497)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:310)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:248)
at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:620)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:540)
at java.lang.Thread.run(Thread.java:745)
}]
at org.neo4j.jdbc.rest.StreamingParser.handleErrors(StreamingParser.java:359)
at org.neo4j.jdbc.rest.StreamingParser.skipTo(StreamingParser.java:333)
at org.neo4j.jdbc.rest.StreamingParser.nextResult(StreamingParser.java:148)
at org.neo4j.jdbc.rest.StreamingParser$2.hasNext(StreamingParser.java:283)
at org.neo4j.jdbc.rest.TransactionalQueryExecutor.executeQuery(TransactionalQueryExecutor.java:209)
at org.neo4j.jdbc.Neo4jConnection.executeQuery(Neo4jConnection.java:388)
... 8 more

我们如何解决此问题

0 个答案:

没有答案