org.neo4j.graphdb.NotInTransactionException,同时将Neo4j 1.9.8升级到2.3.8

时间:2018-06-20 07:19:46

标签: java neo4j

意外错误:org.neo4j.graphdb.NotInTransactionException     在org.neo4j.kernel.impl.core.ThreadToStatementContextBridge.assertInUnterminatedTransaction(ThreadToStatementContextBridge.java:72)     在org.neo4j.kernel.impl.core.ThreadToStatementContextBridge.getTopLevelTransactionBoundToThisThread(ThreadToStatementContextBridge.java:106)     在org.neo4j.kernel.impl.core.ThreadToStatementContextBridge.getKernelTransactionBoundToThisThread(ThreadToStatementContextBridge.java:113)     在org.neo4j.kernel.impl.core.ThreadToStatementContextBridge.get(ThreadToStatementContextBridge.java:65)     在org.neo4j.kernel.impl.coreapi.LegacyIndexProxy.query(LegacyIndexProxy.java:363)     在au.com.pwc.nodalgeography.graph.GraphNodeIterator.getNext(GraphNodeIterator.java:32)     在au.com.pwc.nodalgeography.graph.GraphNodeIterator.getNext(GraphNodeIterator.java:14)     在com.googlecode.totallylazy.iterators.StatefulIterator.hasNext(StatefulIterator.java:23)     在com.googlecode.totallylazy.iterators.StatefulIterator.next(StatefulIterator.java:36)     在com.googlecode.totallylazy.Computation $ 2.call(Computation.java:80)     在com.googlecode.totallylazy.callables.LazyCallable.get(LazyCallable.java:19)     在com.googlecode.totallylazy.Lazy.call(Lazy.java:22

console.log(format.e001);

1 个答案:

答案 0 :(得分:0)

无论您对数据库执行任何操作,都需要确保您在事务范围之内。例如

try(Transaction tx = db.beginTransaction()) {    
  // do database work in this scope
}

// but no database work here

我认为2.0系列可能有所更改,要求您显式创建这些事务,因此这可能是升级导致的问题。