<p dir="auto">Having such graph: <a href="http://console.neo4j.org/r/9cwo4x" rel="nofollow">http://console.neo4j.org/r/9cwo4x</a></p>
<p dir="auto">The query works fine for the most of my cases, but in this particular case it takes an eternity to complete and returns many duplicates. Is there a way to avoid such behavior?</p>
<p dir="auto">I tried to delete a node in neo4j console /web admin and it did not work.</p>
<p dir="auto">2013-10-15 12:39:53.473+0000 ERROR [o.n.k.i.t.TxManager]: TM error tx commit<br>
javax.transaction.HeuristicRollbackException: Failed to commit, transaction rolledback ---&gt; javax.transaction.xa.XAException<br>
at org.neo4j.kernel.impl.transaction.TxManager.commit(TxManager.java:504) [neo4j-kernel-1.9.4.jar:1.9.4]<br>
at org.neo4j.kernel.impl.transaction.TxManager.commit(TxManager.java:344) [neo4j-kernel-1.9.4.jar:1.9.4]<br>
at org.neo4j.kernel.impl.transaction.TransactionImpl.commit(TransactionImpl.java:134) ~[neo4j-kernel-1.9.4.jar:1.9.4]<br>
at org.neo4j.kernel.TopLevelTransaction.finish(TopLevelTransaction.java:127) ~[neo4j-kernel-1.9.4.jar:1.9.4]<br>
at org.neo4j.cypher.internal.ClosingIterator$$anonfun$close$1.apply$mcV$sp(ClosingIterator.scala:58) ~[neo4j-cypher-1.9.4.jar:1.9.4]<br>
at org.neo4j.cypher.internal.ClosingIterator$$anonfun$close$1.apply(ClosingIterator.scala:52) ~[neo4j-cypher-1.9.4.jar:1.9.4]<br>
at org.neo4j.cypher.internal.ClosingIterator$$anonfun$close$1.apply(ClosingIterator.scala:52) ~[neo4j-cypher-1.9.4.jar:1.9.4]<br>
at org.neo4j.cypher.internal.ClosingIterator.translateException(ClosingIterator.scala:63) ~[neo4j-cypher-1.9.4.jar:1.9.4]<br>
at org.neo4j.cypher.internal.ClosingIterator.close(ClosingIterator.scala:52) ~[neo4j-cypher-1.9.4.jar:1.9.4]<br>
at org.neo4j.cypher.internal.ClosingIterator$$anonfun$hasNext$1.apply$mcZ$sp(ClosingIterator.scala:38) ~[neo4j-cypher-1.9.4.jar:1.9.4]<br>
at org.neo4j.cypher.internal.ClosingIterator$$anonfun$hasNext$1.apply(ClosingIterator.scala:35) ~[neo4j-cypher-1.9.4.jar:1.9.4]<br>
at org.neo4j.cypher.internal.ClosingIterator$$anonfun$hasNext$1.apply(ClosingIterator.scala:35) ~[neo4j-cypher-1.9.4.jar:1.9.4]<br>
at org.neo4j.cypher.internal.ClosingIterator.failIfThrows(ClosingIterator.scala:86) ~[neo4j-cypher-1.9.4.jar:1.9.4]<br>
at org.neo4j.cypher.internal.ClosingIterator.hasNext(ClosingIterator.scala:35) ~[neo4j-cypher-1.9.4.jar:1.9.4]<br>
at scala.collection.Iterator$class.foreach(Iterator.scala:727) ~[scala-library-2.10.0.jar:na]<br>
at org.neo4j.cypher.internal.ClosingIterator.foreach(ClosingIterator.scala:31) ~[neo4j-cypher-1.9.4.jar:1.9.4]<br>
at scala.collection.generic.Growable$class.$plus$plus$eq(Growable.scala:48) ~[scala-library-2.10.0.jar:na]<br>
at scala.collection.mutable.ListBuffer.$plus$plus$eq(ListBuffer.scala:178) ~[scala-library-2.10.0.jar:na]<br>
at scala.collection.mutable.ListBuffer.$plus$plus$eq(ListBuffer.scala:45) ~[scala-library-2.10.0.jar:na]<br>
at scala.collection.TraversableOnce$class.to(TraversableOnce.scala:259) ~[scala-library-2.10.0.jar:na]<br>
at org.neo4j.cypher.internal.ClosingIterator.to(ClosingIterator.scala:31) ~[neo4j-cypher-1.9.4.jar:1.9.4]<br>
at scala.collection.TraversableOnce$class.toList(TraversableOnce.scala:243) ~[scala-library-2.10.0.jar:na]<br>
at org.neo4j.cypher.internal.ClosingIterator.toList(ClosingIterator.scala:31) ~[neo4j-cypher-1.9.4.jar:1.9.4]<br>
at org.neo4j.cypher.EagerPipeExecutionResult.(EagerPipeExecutionResult.scala:34) ~[neo4j-cypher-1.9.4.jar:1.9.4]<br>
at org.neo4j.cypher.internal.executionplan.ExecutionPlanImpl$$anonfun$6.apply(ExecutionPlanImpl.scala:148) ~[neo4j-cypher-1.9.4.jar:1.9.4]<br>
at org.neo4j.cypher.internal.executionplan.ExecutionPlanImpl$$anonfun$6.apply(ExecutionPlanImpl.scala:145) ~[neo4j-cypher-1.9.4.jar:1.9.4]<br>
at org.neo4j.cypher.internal.executionplan.ExecutionPlanImpl.execute(ExecutionPlanImpl.scala:38) ~[neo4j-cypher-1.9.4.jar:1.9.4]<br>
at org.neo4j.cypher.ExecutionEngine.execute(ExecutionEngine.scala:72) ~[neo4j-cypher-1.9.4.jar:1.9.4]<br>
at org.neo4j.cypher.ExecutionEngine.execute(ExecutionEngine.scala:76) ~[neo4j-cypher-1.9.4.jar:1.9.4]<br>
at org.neo4j.cypher.javacompat.ExecutionEngine.execute(ExecutionEngine.java:79) ~[neo4j-cypher-1.9.4.jar:1.9.4]<br>
at org.neo4j.server.rest.web.CypherService.cypher(CypherService.java:94) ~[neo4j-server-1.9.4.jar:1.9.4]<br>
at sun.reflect.GeneratedMethodAccessor116.invoke(Unknown Source) ~[na:na]<br>
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.7.0_25]<br>
at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.7.0_25]<br>
at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60) ~[jersey-server-1.9.jar:1.9]<br>
at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:205) ~[jersey-server-1.9.jar:1.9]<br>
at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75) ~[jersey-server-1.9.jar:1.9]<br>
at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:288) ~[jersey-server-1.9.jar:1.9]<br>
at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108) ~[jersey-server-1.9.jar:1.9]<br>
at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147) ~[jersey-server-1.9.jar:1.9]<br>
at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84) ~[jersey-server-1.9.jar:1.9]<br>
at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1469) ~[jersey-server-1.9.jar:1.9]<br>
at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1400) ~[jersey-server-1.9.jar:1.9]<br>
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1349) ~[jersey-server-1.9.jar:1.9]<br>
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1339) ~[jersey-server-1.9.jar:1.9]<br>
at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416) ~[jersey-server-1.9.jar:1.9]<br>
at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:537) ~[jersey-server-1.9.jar:1.9]<br>
at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:699) ~[jersey-server-1.9.jar:1.9]<br>
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) ~[servlet-api-2.5-20081211.jar:na]<br>
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511) ~[jetty-6.1.25.jar:6.1.25]<br>
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166) ~[jetty-6.1.25.jar:6.1.25]<br>
at org.neo4j.server.rest.security.SecurityFilter.doFilter(SecurityFilter.java:112) ~[neo4j-server-1.9.4.jar:1.9.4]<br>
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) ~[jetty-6.1.25.jar:6.1.25]<br>
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388) ~[jetty-6.1.25.jar:6.1.25]<br>
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182) ~[jetty-6.1.25.jar:6.1.25]<br>
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765) ~[jetty-6.1.25.jar:6.1.25]<br>
at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114) ~[jetty-6.1.25.jar:6.1.25]<br>
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) ~[jetty-6.1.25.jar:6.1.25]<br>
at org.mortbay.jetty.Server.handle(Server.java:322) ~[jetty-6.1.25.jar:6.1.25]<br>
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542) ~[jetty-6.1.25.jar:6.1.25]<br>
at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:943) ~[jetty-6.1.25.jar:6.1.25]<br>
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756) ~[jetty-6.1.25.jar:6.1.25]<br>
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218) ~[jetty-6.1.25.jar:6.1.25]<br>
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) ~[jetty-6.1.25.jar:6.1.25]<br>
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410) ~[jetty-6.1.25.jar:6.1.25]<br>
at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582) ~[jetty-util-6.1.25.jar:6.1.25]<br>
Caused by: javax.transaction.xa.XAException: null<br>
at org.neo4j.kernel.impl.nioneo.xa.WriteTransaction.doPrepare(WriteTransaction.java:171) ~[neo4j-kernel-1.9.4.jar:1.9.4]<br>
at org.neo4j.kernel.impl.transaction.xaframework.XaTransaction.prepare(XaTransaction.java:302) ~[neo4j-kernel-1.9.4.jar:1.9.4]<br>
at org.neo4j.kernel.impl.transaction.xaframework.XaResourceManager.prepare(XaResourceManager.java:340) ~[neo4j-kernel-1.9.4.jar:1.9.4]<br>
at org.neo4j.kernel.impl.transaction.xaframework.XaResourceHelpImpl.prepare(XaResourceHelpImpl.java:101) ~[neo4j-kernel-1.9.4.jar:1.9.4]<br>
at org.neo4j.kernel.impl.transaction.TransactionImpl.doCommit(TransactionImpl.java:517) ~[neo4j-kernel-1.9.4.jar:1.9.4]<br>
at org.neo4j.kernel.impl.transaction.TxManager.commit(TxManager.java:394) [neo4j-kernel-1.9.4.jar:1.9.4]<br>
... 65 common frames omitted<br>
Caused by: org.neo4j.kernel.impl.nioneo.store.ConstraintViolationException: Node record Node[161,used=false,rel=7,prop=188] still has relationships<br>
... 71 common frames omitted</p>