spring-data-neo4jneo4j-ogmneo4j-bolt

Spring Data Neo4J - Manage Connection to graph DB


We have an application that must connect to multiple graph DBs. The database that we want to connect to can be determined in the header of an HTTP request.

I have tried writing an HandlerInterceptorAdapter and auto wiring the SessionFactory and then building a Configuration with the proper URI for the graph I want to connect to. Then I used sessionFactor.getDriver().configure(newConfiguration). This worked for the first call, but every subsequent call failed with a message stating the driver was closed.

Is it possible to do such a thing with Spring Data Neo4J?


Solution

  • Spring Data Neo4j has no support for this feature. In general the whole connection and class scanning mechanism will start when your application starts. Altering the configuration during runtime is not intended.