Issue 1:
Having such graph: http://console.neo4j.org/r/9cwo4x

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?

Issue 2:
I tried to delete a node in neo4j console /web admin and it did not work.

2013-10-15 12:39:53.473+0000 ERROR [o.n.k.i.t.TxManager]: TM error tx commit

javax.transaction.HeuristicRollbackException: Failed to commit, transaction rolledback ---> javax.transaction.xa.XAException

at org.neo4j.kernel.impl.transaction.TxManager.commit(TxManager.java:504) [neo4j-kernel-1.9.4.jar:1.9.4]

at org.neo4j.kernel.impl.transaction.TxManager.commit(TxManager.java:344) [neo4j-kernel-1.9.4.jar:1.9.4]

at org.neo4j.kernel.impl.transaction.TransactionImpl.commit(TransactionImpl.java:134) ~[neo4j-kernel-1.9.4.jar:1.9.4]

at org.neo4j.kernel.TopLevelTransaction.finish(TopLevelTransaction.java:127) ~[neo4j-kernel-1.9.4.jar:1.9.4]

at org.neo4j.cypher.internal.ClosingIterator$$anonfun$close$1.apply$mcV$sp(ClosingIterator.scala:58) ~[neo4j-cypher-1.9.4.jar:1.9.4]

at org.neo4j.cypher.internal.ClosingIterator$$anonfun$close$1.apply(ClosingIterator.scala:52) ~[neo4j-cypher-1.9.4.jar:1.9.4]

at org.neo4j.cypher.internal.ClosingIterator$$anonfun$close$1.apply(ClosingIterator.scala:52) ~[neo4j-cypher-1.9.4.jar:1.9.4]

at org.neo4j.cypher.internal.ClosingIterator.translateException(ClosingIterator.scala:63) ~[neo4j-cypher-1.9.4.jar:1.9.4]

at org.neo4j.cypher.internal.ClosingIterator.close(ClosingIterator.scala:52) ~[neo4j-cypher-1.9.4.jar:1.9.4]

at org.neo4j.cypher.internal.ClosingIterator$$anonfun$hasNext$1.apply$mcZ$sp(ClosingIterator.scala:38) ~[neo4j-cypher-1.9.4.jar:1.9.4]

at org.neo4j.cypher.internal.ClosingIterator$$anonfun$hasNext$1.apply(ClosingIterator.scala:35) ~[neo4j-cypher-1.9.4.jar:1.9.4]

at org.neo4j.cypher.internal.ClosingIterator$$anonfun$hasNext$1.apply(ClosingIterator.scala:35) ~[neo4j-cypher-1.9.4.jar:1.9.4]

at org.neo4j.cypher.internal.ClosingIterator.failIfThrows(ClosingIterator.scala:86) ~[neo4j-cypher-1.9.4.jar:1.9.4]

at org.neo4j.cypher.internal.ClosingIterator.hasNext(ClosingIterator.scala:35) ~[neo4j-cypher-1.9.4.jar:1.9.4]

at scala.collection.Iterator$class.foreach(Iterator.scala:727) ~[scala-library-2.10.0.jar:na]

at org.neo4j.cypher.internal.ClosingIterator.foreach(ClosingIterator.scala:31) ~[neo4j-cypher-1.9.4.jar:1.9.4]

at scala.collection.generic.Growable$class.$plus$plus$eq(Growable.scala:48) ~[scala-library-2.10.0.jar:na]

at scala.collection.mutable.ListBuffer.$plus$plus$eq(ListBuffer.scala:178) ~[scala-library-2.10.0.jar:na]

at scala.collection.mutable.ListBuffer.$plus$plus$eq(ListBuffer.scala:45) ~[scala-library-2.10.0.jar:na]

at scala.collection.TraversableOnce$class.to(TraversableOnce.scala:259) ~[scala-library-2.10.0.jar:na]

at org.neo4j.cypher.internal.ClosingIterator.to(ClosingIterator.scala:31) ~[neo4j-cypher-1.9.4.jar:1.9.4]

at scala.collection.TraversableOnce$class.toList(TraversableOnce.scala:243) ~[scala-library-2.10.0.jar:na]

at org.neo4j.cypher.internal.ClosingIterator.toList(ClosingIterator.scala:31) ~[neo4j-cypher-1.9.4.jar:1.9.4]

at org.neo4j.cypher.EagerPipeExecutionResult.(EagerPipeExecutionResult.scala:34) ~[neo4j-cypher-1.9.4.jar:1.9.4]

at org.neo4j.cypher.internal.executionplan.ExecutionPlanImpl$$anonfun$6.apply(ExecutionPlanImpl.scala:148) ~[neo4j-cypher-1.9.4.jar:1.9.4]

at org.neo4j.cypher.internal.executionplan.ExecutionPlanImpl$$anonfun$6.apply(ExecutionPlanImpl.scala:145) ~[neo4j-cypher-1.9.4.jar:1.9.4]

at org.neo4j.cypher.internal.executionplan.ExecutionPlanImpl.execute(ExecutionPlanImpl.scala:38) ~[neo4j-cypher-1.9.4.jar:1.9.4]

at org.neo4j.cypher.ExecutionEngine.execute(ExecutionEngine.scala:72) ~[neo4j-cypher-1.9.4.jar:1.9.4]

at org.neo4j.cypher.ExecutionEngine.execute(ExecutionEngine.scala:76) ~[neo4j-cypher-1.9.4.jar:1.9.4]

at org.neo4j.cypher.javacompat.ExecutionEngine.execute(ExecutionEngine.java:79) ~[neo4j-cypher-1.9.4.jar:1.9.4]

at org.neo4j.server.rest.web.CypherService.cypher(CypherService.java:94) ~[neo4j-server-1.9.4.jar:1.9.4]

at sun.reflect.GeneratedMethodAccessor116.invoke(Unknown Source) ~[na:na]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.7.0_25]

at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.7.0_25]

at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60) ~[jersey-server-1.9.jar:1.9]

at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:205) ~[jersey-server-1.9.jar:1.9]

at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75) ~[jersey-server-1.9.jar:1.9]

at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:288) ~[jersey-server-1.9.jar:1.9]

at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108) ~[jersey-server-1.9.jar:1.9]

at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147) ~[jersey-server-1.9.jar:1.9]

at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84) ~[jersey-server-1.9.jar:1.9]

at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1469) ~[jersey-server-1.9.jar:1.9]

at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1400) ~[jersey-server-1.9.jar:1.9]

at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1349) ~[jersey-server-1.9.jar:1.9]

at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1339) ~[jersey-server-1.9.jar:1.9]

at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416) ~[jersey-server-1.9.jar:1.9]

at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:537) ~[jersey-server-1.9.jar:1.9]

at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:699) ~[jersey-server-1.9.jar:1.9]

at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) ~[servlet-api-2.5-20081211.jar:na]

at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511) ~[jetty-6.1.25.jar:6.1.25]

at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166) ~[jetty-6.1.25.jar:6.1.25]

at org.neo4j.server.rest.security.SecurityFilter.doFilter(SecurityFilter.java:112) ~[neo4j-server-1.9.4.jar:1.9.4]

at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) ~[jetty-6.1.25.jar:6.1.25]

at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388) ~[jetty-6.1.25.jar:6.1.25]

at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182) ~[jetty-6.1.25.jar:6.1.25]

at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765) ~[jetty-6.1.25.jar:6.1.25]

at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114) ~[jetty-6.1.25.jar:6.1.25]

at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) ~[jetty-6.1.25.jar:6.1.25]

at org.mortbay.jetty.Server.handle(Server.java:322) ~[jetty-6.1.25.jar:6.1.25]

at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542) ~[jetty-6.1.25.jar:6.1.25]

at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:943) ~[jetty-6.1.25.jar:6.1.25]

at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756) ~[jetty-6.1.25.jar:6.1.25]

at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218) ~[jetty-6.1.25.jar:6.1.25]

at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) ~[jetty-6.1.25.jar:6.1.25]

at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410) ~[jetty-6.1.25.jar:6.1.25]

at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582) ~[jetty-util-6.1.25.jar:6.1.25]

Caused by: javax.transaction.xa.XAException: null

at org.neo4j.kernel.impl.nioneo.xa.WriteTransaction.doPrepare(WriteTransaction.java:171) ~[neo4j-kernel-1.9.4.jar:1.9.4]

at org.neo4j.kernel.impl.transaction.xaframework.XaTransaction.prepare(XaTransaction.java:302) ~[neo4j-kernel-1.9.4.jar:1.9.4]

at org.neo4j.kernel.impl.transaction.xaframework.XaResourceManager.prepare(XaResourceManager.java:340) ~[neo4j-kernel-1.9.4.jar:1.9.4]

at org.neo4j.kernel.impl.transaction.xaframework.XaResourceHelpImpl.prepare(XaResourceHelpImpl.java:101) ~[neo4j-kernel-1.9.4.jar:1.9.4]

at org.neo4j.kernel.impl.transaction.TransactionImpl.doCommit(TransactionImpl.java:517) ~[neo4j-kernel-1.9.4.jar:1.9.4]

at org.neo4j.kernel.impl.transaction.TxManager.commit(TxManager.java:394) [neo4j-kernel-1.9.4.jar:1.9.4]

... 65 common frames omitted

Caused by: org.neo4j.kernel.impl.nioneo.store.ConstraintViolationException: Node record Node[161,used=false,rel=7,prop=188] still has relationships

... 71 common frames omitted