Neo4j 嵌入 OSGi
我想在嵌入模式下使用 neo4j。正如我所见,不可能在不同的进程中共享 GraphDatabase 实例。现在我的想法是使用嵌入在 OSGi 容器中的 neo4j 为不同组件共享相同的数据库。编写一个 BundleActivator
来创建 GraphDB
并将其通过服务公开给其他 OSGi 包是个好主意吗?
I want to use neo4j in embedded mode. As I have seen it's not possible to share the GraphDatabase
instance in different processes. Now my idea was to use the neo4j embedded in an OSGi container to share the same db for different components. Is it a good idea to write a BundleActivator
which creates the GraphDB
and exposes it to other OSGi bundles with a service?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
有一个带有测试的示例模板设置,它使用 neo4j 相关组件制作了一个超级包。尝试让我们知道进展如何。请参阅 这里是一个典型的激活器。
there is An example template setup with tests making a super-bundle out of the neo4j-related components. Try and let us know how it goes. See here for a typical Activator.
现在您可以使用适当的 DI 来实例化数据库,例如 http:// /docs.neo4j.org/chunked/snapshot/tutorials-java-embedded-osgi.html
Now you can use proper DI to instantiate the DB, like http://docs.neo4j.org/chunked/snapshot/tutorials-java-embedded-osgi.html