我有一个使用Spring Data Neo4j的非常复杂的项目。一切都适用于版本3,但现在,我们正在尝试迁移到SDN 4,我有时会遇到保存节点的问题(我没有使用保存深度级别,所以我假设它默认为-1所以改变的一切都被保存了)。
运行myNoderepository.save(myNode)
时错误日志如下:
org.neo4j.ogm.session.result.ResultProcessingException: "errors":[{"code":"Neo.ClientError.Statement.InvalidSyntax","message":"Query cannot conclude with MATCH (must be RETURN or an update clause) (line 1, column 859 (offset: 858))\n\"MATCH ()-[_0]->() WHERE id(_0)={_0} SET _0+={_0_props} WITH _0 MATCH ()-[_10]->() WHERE id(_10)={_10} SET _10+={_10_props} WITH _0,_10 MATCH ()-[_11]->() WHERE id(_11)={_11} WITH _0,_10 MATCH ()-[_13]->() WHERE id(_13)={_13} SET _13+={_13_props} WITH _0,_10,_13 MATCH ()-[_15]->() WHERE id(_15)={_15} SET _15+={_15_props} WITH _0,_10,_13,_15 MATCH ()-[_2]->() WHERE id(_2)={_2} SET _2+={_2_props} WITH _0,_10,_13,_15,_2 MATCH ()-[_20]->() WHERE id(_20)={_20} SET _20+={_20_props} WITH _0,_10,_13,_15,_2,_20 MATCH ()-[_22]->() WHERE id(_22)={_22} SET _22+={_22_props} WITH _0,_10,_13,_15,_2,_20,_22 MATCH ()-[_24]->() WHERE id(_24)={_24} WITH _0,_10,_13,_15,_2,_20,_22 MATCH ()-[_4]->() WHERE id(_4)={_4} SET _4+={_4_props} WITH _0,_10,_13,_15,_2,_20,_22,_4 MATCH ()-[_6]->() WHERE id(_6)={_6} SET _6+={_6_props} WITH _0,_10,_13,_15,_2,_20,_22,_4,_6 MATCH ()-[_8]->() WHERE id(_8)={_8}\"\n ^"}]}
at org.neo4j.ogm.session.response.JsonResponse.parseErrors(JsonResponse.java:165) ~[neo4j-ogm-1.1.2.jar:na]
at org.neo4j.ogm.session.response.JsonResponse.parseColumns(JsonResponse.java:139) ~[neo4j-ogm-1.1.2.jar:na]
at org.neo4j.ogm.session.response.JsonResponse.initialiseScan(JsonResponse.java:75) ~[neo4j-ogm-1.1.2.jar:na]
at org.neo4j.ogm.session.response.RowModelResponse.initialiseScan(RowModelResponse.java:63) ~[neo4j-ogm-1.1.2.jar:na]
at org.neo4j.ogm.session.response.RowModelResponse.<init>(RowModelResponse.java:37) ~[neo4j-ogm-1.1.2.jar:na]
at org.neo4j.ogm.session.response.SessionResponseHandler.updateObjects(SessionResponseHandler.java:87) ~[neo4j-ogm-1.1.2.jar:na]
at org.neo4j.ogm.session.delegates.SaveDelegate.save(SaveDelegate.java:69) ~[neo4j-ogm-1.1.2.jar:na]
at org.neo4j.ogm.session.delegates.SaveDelegate.save(SaveDelegate.java:43) ~[neo4j-ogm-1.1.2.jar:na]
at org.neo4j.ogm.session.Neo4jSession.save(Neo4jSession.java:386) ~[neo4j-ogm-1.1.2.jar:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_79]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:1.7.0_79]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.7.0_79]
at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.7.0_79]
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:302) ~[spring-aop-4.2.2.RELEASE.jar:4.2.2.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190) [spring-aop-4.2.2.RELEASE.jar:4.2.2.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) [spring-aop-4.2.2.RELEASE.jar:4.2.2.RELEASE]
at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:133) ~[spring-aop-4.2.2.RELEASE.jar:4.2.2.RELEASE]
at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:121) ~[spring-aop-4.2.2.RELEASE.jar:4.2.2.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) [spring-aop-4.2.2.RELEASE.jar:4.2.2.RELEASE]
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207) ~[spring-aop-4.2.2.RELEASE.jar:4.2.2.RELEASE]
at com.sun.proxy.$Proxy251.save(Unknown Source) ~[na:na]
at org.springframework.data.neo4j.repository.GraphRepositoryImpl.save(GraphRepositoryImpl.java:46) ~[spring-data-neo4j-4.0.0.RELEASE.jar:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_79]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:1.7.0_79]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.7.0_79]
at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.7.0_79]
at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.executeMethodOn(RepositoryFactorySupport.java:475) ~[spring-data-commons-1.11.0.RELEASE.jar:na]
at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:460) ~[spring-data-commons-1.11.0.RELEASE.jar:na]
at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:432) ~[spring-data-commons-1.11.0.RELEASE.jar:na]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) [spring-aop-4.2.2.RELEASE.jar:4.2.2.RELEASE]
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99) ~[spring-tx-4.2.2.RELEASE.jar:4.2.2.RELEASE]
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281) ~[spring-tx-4.2.2.RELEASE.jar:4.2.2.RELEASE]
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) [spring-tx-4.2.2.RELEASE.jar:4.2.2.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) [spring-aop-4.2.2.RELEASE.jar:4.2.2.RELEASE]
at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:136) ~[spring-tx-4.2.2.RELEASE.jar:4.2.2.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) [spring-aop-4.2.2.RELEASE.jar:4.2.2.RELEASE]
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92) ~[spring-aop-4.2.2.RELEASE.jar:4.2.2.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) [spring-aop-4.2.2.RELEASE.jar:4.2.2.RELEASE]
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207) ~[spring-aop-4.2.2.RELEASE.jar:4.2.2.RELEASE]
at com.sun.proxy.$Proxy303.save(Unknown Source) ~[na:na]
错误日志对我说的不多,因为它似乎在存储库的保存方法下可能有些错误...