我们在多线程应用程序中在Linux 64和JRE 1 7 51上嵌入了Neo4j 2.0.1社区版。
间歇性地(很少)当我们删除关系并分别在同一事务中执行密码时,我们会得到以下异常。
我们是否应该对这些删除使用悲观锁?这些例外是什么意思?
ResourceAcquisitionFailedException
org.neo4j.kernel.impl.persistence.ResourceAcquisitionFailedException: The transaction is marked for rollback only.
at org.neo4j.kernel.impl.persistence.PersistenceManager$ResourceHolder.enlist(PersistenceManager.java:408)
at org.neo4j.kernel.impl.persistence.PersistenceManager$ResourceHolder.forWriting(PersistenceManager.java:384)
at org.neo4j.kernel.impl.api.KernelTransactionImplementation.ensureWriteTransaction(KernelTransactionImplementation.java:181)
at org.neo4j.kernel.impl.api.KernelTransactionImplementation.upgradeToDataTransaction(KernelTransactionImplementation.java:211)
at org.neo4j.kernel.impl.api.KernelStatement.dataWriteOperations(KernelStatement.java:84)
at org.neo4j.kernel.impl.core.RelationshipProxy.delete(RelationshipProxy.java:84)
org.neo4j.cypher.CypherExecutionException
org.neo4j.cypher.CypherExecutionException at org.neo4j.cypher.internal.compiler.v2_0.spi.ExceptionTranslatingQueryContext.org$neo4j$cypher$internal$compiler$v2_0$spi$ExceptionTranslatingQueryContext$$translateException(ExceptionTranslatingQueryContext.scala:151)
at org.neo4j.cypher.internal.compiler.v2_0.spi.ExceptionTranslatingQueryContext.getLabelsForNode(ExceptionTranslatingQueryContext.scala:44)
at org.neo4j.cypher.internal.compiler.v2_0.spi.DelegatingQueryContext.getLabelsForNode(DelegatingQueryContext.scala:39)
at org.neo4j.cypher.internal.compiler.v2_0.spi.QueryContext$class.isLabelSetOnNode(QueryContext.scala:54)
at org.neo4j.cypher.internal.compiler.v2_0.spi.DelegatingQueryContext.isLabelSetOnNode(DelegatingQueryContext.scala:26)
at org.neo4j.cypher.internal.compiler.v2_0.commands.HasLabel.isMatch(Predicate.scala:252)
at org.neo4j.cypher.internal.compiler.v2_0.commands.And.isMatch(Predicate.scala:62)
at org.neo4j.cypher.internal.compiler.v2_0.commands.And.isMatch(Predicate.scala:62)
at org.neo4j.cypher.internal.compiler.v2_0.commands.Predicate.isTrue(Predicate.scala:33)
at org.neo4j.cypher.internal.compiler.v2_0.pipes.matching.SingleStep$FilteringIterator.isValidNext(SingleStep.scala:135)
at org.neo4j.cypher.internal.compiler.v2_0.pipes.matching.SingleStep$FilteringIterator.computeNext(SingleStep.scala:118)
at org.neo4j.cypher.internal.compiler.v2_0.pipes.matching.SingleStep$FilteringIterator.next(SingleStep.scala:108)
at org.neo4j.cypher.internal.compiler.v2_0.pipes.matching.SingleStep$FilteringIterator.next(SingleStep.scala:98)
at scala.collection.convert.Wrappers$IteratorWrapper.next(Wrappers.scala:30)
at org.neo4j.kernel.impl.traversal.TraversalBranchImpl.next(TraversalBranchImpl.java:138)
at org.neo4j.kernel.impl.traversal.TraversalBranchWithState.next(TraversalBranchWithState.java:32)
at org.neo4j.kernel.impl.traversal.StartNodeTraversalBranch.next(StartNodeTraversalBranch.java:50)
at org.neo4j.graphdb.traversal.PreorderDepthFirstSelector.next(PreorderDepthFirstSelector.java:49)
at org.neo4j.kernel.impl.traversal.MonoDirectionalTraverserIterator.fetchNextOrNull(MonoDirectionalTraverserIterator.java:68)
at org.neo4j.kernel.impl.traversal.MonoDirectionalTraverserIterator.fetchNextOrNull(MonoDirectionalTraverserIterator.java:35)
at org.neo4j.helpers.collection.PrefetchingIterator.hasNext(PrefetchingIterator.java:55)
at scala.collection.convert.Wrappers$JIteratorWrapper.hasNext(Wrappers.scala:41)
at scala.collection.Iterator$$anon$13.hasNext(Iterator.scala:371)
at scala.collection.Iterator$$anon$13.hasNext(Iterator.scala:371)
at scala.collection.Iterator$$anon$14.hasNext(Iterator.scala:388)
at scala.collection.Iterator$class.isEmpty(Iterator.scala:256)
at scala.collection.AbstractIterator.isEmpty(Iterator.scala:1157)
at org.neo4j.cypher.internal.compiler.v2_0.pipes.SlicePipe.internalCreateResults(SlicePipe.scala:36)
at org.neo4j.cypher.internal.compiler.v2_0.pipes.PipeWithSource.createResults(Pipe.scala:71)
at org.neo4j.cypher.internal.compiler.v2_0.pipes.PipeWithSource.createResults(Pipe.scala:68)
at org.neo4j.cypher.internal.compiler.v2_0.pipes.PipeWithSource.createResults(Pipe.scala:71)
at org.neo4j.cypher.internal.compiler.v2_0.pipes.PipeWithSource.createResults(Pipe.scala:68)
at org.neo4j.cypher.internal.compiler.v2_0.executionplan.ExecutionPlanBuilder.org$neo4j$cypher$internal$compiler$v2_0$executionplan$ExecutionPlanBuilder$$prepareStateAndResult(ExecutionPlanBuilder.scala:149)
at org.neo4j.cypher.internal.compiler.v2_0.executionplan.ExecutionPlanBuilder$$anonfun$2.apply(ExecutionPlanBuilder.scala:126)
at org.neo4j.cypher.internal.compiler.v2_0.executionplan.ExecutionPlanBuilder$$anonfun$2.apply(ExecutionPlanBuilder.scala:125)
at org.neo4j.cypher.internal.compiler.v2_0.executionplan.ExecutionPlanBuilder$$anon$6.execute(ExecutionPlanBuilder.scala:50)
at org.neo4j.cypher.internal.ExecutionPlanWrapperForV2_0.execute(CypherCompiler.scala:93)
at org.neo4j.cypher.ExecutionEngine.execute(ExecutionEngine.scala:61)
at org.neo4j.cypher.ExecutionEngine.execute(ExecutionEngine.scala:65)
at org.neo4j.cypher.javacompat.ExecutionEngine.execute(ExecutionEngine.java:78)