Skip to content

Spatial 0.27.0-neo4j-4.0.3

Compare
Choose a tag to compare
@craigtaverner craigtaverner released this 07 Mar 23:14
· 4 commits to 0.27-neo4j-4.0 since this release

Since this library was originally written in 2010 when Neo4j was still releasing early 1.x versions,
it made use of internal Java API's that were deprecated over the years, some as early as Neo4j 2.x.
When Neo4j 4.0 was released, it entirely removed a number of deprecated API's, and completely changed
the Transaction API.
This meant that the spatial library needed a major refactoring to work with Neo4j 4.x:

  • The library previously depended on outer and inner transactions, so code that was called
    within a transaction (like procedures) could be common with code that was not (Java API).
    The removal of this support required that all internal API's needed to include parameters
    for the current transaction, and only the specific surface designed for embedded use not.
  • The library made use of Lucene based explicit indexes in many places.
    The removal of support for explicit indexes required new solutions in sevaral places:
    • The OSMImporter used instead normal Neo4j schema indexes (introduced in 2.0), but these
      can only be created in separate index transactions. Due to the new transaction model this
      required stopping the import transaction, starting an index transaction, and then restarting
      the import transaction. All of this is incompatible with procedures, which already have
      an incoming, non-stoppable transaction. The solution was to run the actual import in another
      thread, retaining the original batch-processing capabilities, but requiring modifying the
      security model of the procedure context.
    • The ExplicitIndexBackedPointIndex needed to be modified to instead use a schema index.
      This required similar tricks as employed in the OSMImporter.
  • Neo4j 4.0 runs only in Java 11, and GeoTools only supported up to Java 1.8 until recently.
    This required an upgrade to the GeoTools and JTS libraries to version 24.2.
    This in turn required a re-write of the Neo4jDataStore interface since the older API had
    long been deprecated, and was entirely unavailable in newer versions.

Consequences of this port:

  • The large number of changes mean that the 0.27.0 version should be considered very alpha.
  • Many API's have changed and client code might need to be adapted to take the changes into account.
  • The new GeoServer API is entirely untested, besides the existing unit and integration tests.
  • The need to manage threads and create schema indexes results in the procedures requiring
    unrestricted access to internal API's of Neo4j.

This last point means that you need to set the following in your neo4j.conf file:

dbms.security.procedures.unrestricted=spatial.*