UnexpectedUpgradingStoreVersionException - "Expected 'v0.A.3' but file is version " 与 Neo4j 服务器和 Hibernate OGM

UnexpectedUpgradingStoreVersionException - "Expected 'v0.A.3' but file is version " with Neo4j Server and Hibernate OGM

我正在尝试 Neo4j + Hibernate OGM。我从 this tutorial. Starting from there I am now able to create and update entities, and also run some custom queries using JP-QL queries: 1, 2.

开始

使用Neo4j Community Edition 3.1.0 for Windows 64 bit,选择我的嵌入式数据库的数据目录,然后导航到网络视图,我能够成功查看数据。

然而,在那之后,我在运行我的Java应用程序中遇到了以下问题。

  1. 当我尝试运行应用程序时,同时Neo4j社区版服务器也在运行ning,我遇到了以下问题:

    org.neo4j.kernel.StoreLockException: Store and its lock file has been locked by another process: target\test_data_dir\store_lock. Please ensure no other process is using this database, and that the directory is writable (required even for read-only access)

    这个错误似乎很容易解释,可以通过停止服务器来解决。我的问题是,有没有tool/configuration,可以让我同时做这两个事情;即运行应用程序,并在服务器中查看数据。

  2. 我在停止服务器并再次 运行 应用程序后遇到的另一个主要错误是下面的错误。

    org.neo4j.kernel.impl.storemigration.StoreUpgrader$UnexpectedUpgradingStoreVersionException: 'G:\Workspace\Java\Neo4jTest\target\test_data_dir\neostore.nodestore.db' has a store version number that we cannot upgrade from. Expected 'v0.A.3' but file is version '

    如果我删除数据库并再次启动应用程序(从头开始),那么在我启动服务器之前一切正常。如何解决?

附加信息:

同一时间只有一个进程可以获得嵌入式 Neo4j 上的锁。

因此,如果您使用的是 OGM,则无法使用 Neo4j 服务器或 vicecersa 访问它。我认为目前没有任何方法可以解决这个问题。

如果您想在应用程序 运行 时检查数据库,您需要使用 Bolt 协议或 HTTP API 连接到服务器。您只需要更新 Hibernate OGM 配置文件。

Hibernate OGM 5.0.4.Final 使用的是旧版本的 Neo4j:2.3.5 当您打开和关闭服务器时,文件版本发生变化,Hibernate OGM 无法再识别它。

Hibernate OGM 5.1.0.Beta3 目前正在使用 Neo4j 3.0.8,但我打开了一个问题来升级它。