Neo4j:GraphDatabaseService.registerTransactionEventHandler()似乎不起作用 [英] Neo4j: GraphDatabaseService.registerTransactionEventHandler() does not seem to work

查看:64
本文介绍了Neo4j:GraphDatabaseService.registerTransactionEventHandler()似乎不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

关于我之前的问题:

我对GraphDatabaseService.registerTransactionEventHandler()有问题.当我尝试运行

I have a problem with GraphDatabaseService.registerTransactionEventHandler(). When I try to run this test against this handler, I don't get any calls to the beforeCommit method when running 1.9.2 and only once for a new database for 2.0.0-M03, and for that TransactionData.createdNodes() returns an empty iterator even though a a node has been created. The test fails with org.neo4j.kernel.api.exceptions.PropertyKeyNotFoundException: Property key 'uuid' not found for these reasons.

我做错什么了吗,还是registerTransactionEventHandler中有错误?

Am I doing something wrong, or is there a bug in registerTransactionEventHandler?

推荐答案

http://docs. neo4j.org/chunked/stable/transactions-interaction.html .

You're lacking tx.finish() on the first transaction just after https://github.com/ttiurani/neo4j-uuid/blob/master/src/test/java/org/neo4j/extension/uuid/UUIDTransactionEventHandlerTest.java#L2. Therefore the transaction is not committed and the TransactionEventHandler not called, see http://docs.neo4j.org/chunked/stable/transactions-interaction.html.

这篇关于Neo4j:GraphDatabaseService.registerTransactionEventHandler()似乎不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆