0

I am using Neo4j embedded database on a Play/Scala app. I leaned towards the embedded version because I want to use the Neo4j's Traversal Framework so I can easily create JSON trees using a breadth-first traversal. The problem with embedding the database is that when my Play application hot-reloads, it restarts the application, whereby my app shuts down the server (otherwise I get a db file lock error). This is causing 20s browser reloads between edits. This is especially annoying when editing Play's Twirl html files.

Am I screwed? Should I hide the calls to the embedded db behind a service? Is it worth it to do this just for developement? AFAIK, Neo4j's RESTful service doesn't allow breadth-first traversals. I'm open to suggestions. Thanks.

4

1 回答 1

0

您必须确保您的事务已全部关闭(也许通过添加一个处理该事务的 Java 关闭处理程序使其安全),否则 Neo 将在关闭时等待 20 秒以允许运行 tx 完成。

if (tx != null) tx.close();
db.shutdown();

在开发/测试时,您还可以ImpermanentGraphDatabase根据org.neo4j:neo4j-kernel:test-jar:2.1.5

看:

于 2014-10-12T06:37:40.957 回答