3

I am creating a principal node in neo4j and creating its relationship with School, it works and principal object and relationship succesfully created in neo4j.

SchoolHasPrincipal school_has_principle = new SchoolHasPrincipal(school, principal);
principal.setHasPrincipalRelationship(school_has_principle);
Principal newPrincipal = principalDao.create(principal);
System.out.println("principal created>>"+newPrincipal.getId());
SchoolHasPrincipal shp = schoolHasPrincipalDao.create(school_has_principle);
System.out.println("relationship created>>"+shp.getId());

but after working for sometimes ,suddenly it gives error

Execution exception[[CypherTransactionExecutionException: Error executing cypher statements [{code=Neo.DatabaseError.Statement.ExecutionFailure, message=Relationship 2375 has been deleted, stackTrace=java.lang.IllegalStateException: Relationship 2375 has been deleted\n\tat org.neo4j.kernel.impl.api.StateHandlingStatementOperations.relationshipGetAllProperties(StateHandlingStatementOperations.java:824)\n\tat org.neo4j.kernel.impl.api.ConstraintEnforcingEntityOperations.relationshipGetAllProperties(ConstraintEnforcingEntityOperations.java:339)\n\tat org.neo4j.kernel.impl.api.OperationsFacade.relationshipGetAllProperties(OperationsFacade.java:262)\n\tat org.neo4j.kernel.impl.core.RelationshipProxy.getPropertyKeys(RelationshipProxy.java:156)\n\tat org.neo4j.server.rest.transactional.Neo4jJsonCodec.writePropertyContainer(Neo4jJsonCodec.java:120)\n\tat org.neo4j.server.rest.transactional.Neo4jJsonCodec.writeValue(Neo4jJsonCodec.java:41)\n\tat org.codehaus.jackson.impl.JsonGeneratorBase.writeObject(JsonGeneratorBase.java:314)\n\tat org.neo4j.server.rest.transactional.RowWriter.write(RowWriter.java:37)\n\tat org.neo4j.server.rest.transactional.AggregatingWriter.write(AggregatingWriter.java:41)\n\tat org.neo4j.server.rest.transactional.ExecutionResultSerializer.writeRows(ExecutionResultSerializer.java:298)\n\tat org.neo4j.server.rest.transactional.ExecutionResultSerializer.statementResult(ExecutionResultSerializer.java:104)\n\tat org.neo4j.server.rest.transactional.TransactionHandle.executeStatements(TransactionHandle.java:278)\n\tat org.neo4j.server.rest.transactional.TransactionHandle.execute(TransactionHandle.java:207)\n\tat org.neo4j.server.rest.transactional.TransactionHandle.execute(TransactionHandle.java:90)\n\tat org.neo4j.server.rest.web.TransactionalService$1.write(TransactionalService.java:180)\n\tat com.sun.jersey.core.impl.provider.entity.StreamingOutputProvider.writeTo(StreamingOutputProvider.java:71)\n\tat com.sun.jersey.core.impl.provider.entity.StreamingOutputProvider.writeTo(StreamingOutputProvider.java:57)\n\tat com.sun.jersey.spi.container.ContainerResponse.write(ContainerResponse.java:306)\n\tat com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1437)\n\tat com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1349)\n\tat com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1339)\n\tat com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416)\n\tat com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:537)\n\tat com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:699)\n\tat javax.servlet.http.HttpServlet.service(HttpServlet.java:848)\n\tat org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:698)\n\tat org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:505)\n\tat org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:211)\n\tat org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1096)\n\tat org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:432)\n\tat org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:175)\n\tat org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1030)\n\tat org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:136)\n\tat org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:52)\n\tat org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)\n\tat org.eclipse.jetty.server.Server.handle(Server.java:445)\n\tat org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:268)\n\tat org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:229)\n\tat org.eclipse.jetty.io.AbstractConnection$ReadCallback.run(AbstractConnection.java:358)\n\tat org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:601)\n\tat org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:532)\n\tat java.lang.Thread.run(Thread.java:745)\n}]]]

tell me if you want any more part of my code

Govind Singh
  • 15,282
  • 14
  • 72
  • 106

0 Answers0