dadrus / jpa-unit

JUnit extension to test javax.persistence entities
Apache License 2.0
29 stars 9 forks source link

Implement support for Neo4J #13

Closed dadrus closed 6 years ago

dadrus commented 7 years ago

Implement an extension to JPA-Unit which supports all the JPA-Unit tools with Neo4J.

The idea is to be able to use JPA providers, which support NoSQL databases, thus to be able to reuse (to a certain extent) existing code and test implementation when switching between different data base types or when using different types of data bases (polyglot persistence) in one project.

dadrus commented 7 years ago

Neo4J implements two modes of communication with it:

  1. as embedded DB. This is unfortunately the only option supported by Kundera and DataNucleus.
  2. as an external DB accessible through a binary bolt or http protocols. These two options are also supported by Hibernate OGM.

If JPA-Unit should remain (binary) independent from any JPA provider implementation, option 1 cannot be used for test purposes: Neo4J does not allow opening multiple driver connections to the embedded DB.

Option 2 can be implemented either using

The first attempt using neo4j-java-driver and Hibernate OGM unfortunately resulted in OGM-1303 with the test domain model used by JPA-Unit integration tests.

dadrus commented 7 years ago

Switching from noe4j-java-driver to neo4j-jdbc-driver made it possible to easily switch from bolt to http for communication purposes with the DB. Unfortunately, there is an error on Hibernate OGM side (given the used domain model) as well. See OGM-1305 for details.

Since we ran out of options (Kundera and DataNucleus do not support remote protocols and with Hibernate OGM there are the aforementioned issues), the implementation of this feature is blocked

dadrus commented 7 years ago

OGM-1303 and OGM-1305 are fixed now (see also hibernate/hibernate-ogm#866). Waiting for the corresponding release to become available

dadrus commented 7 years ago

New issue encountered with hibernate. See OGM-1322.

dadrus commented 6 years ago

The aforementioned issue relates to transaction mamagement only. By reorganizig the project structure, no blocking dependency is given any more