I am trying to use session from Spring Data Neo4j framework. I have the following session initiation method right now, but it is only a work around.
Configuration configuration = new Configuration.Builder() .uri("bolt://localhost") .credentials("neo4j", "neo4j") .build(); SessionFactory sessionFactory = new SessionFactory(configuration, "com.pkg.domain"); session = sessionFactory.openSession();
Now, I want to find a way to retrieve the existing session created by the Spring Boot Application with Neo4j using the config from my application properties. Creating a new session for a request everytime is not the best solution for me, so please suggest if you know a way to retrieve the existing session object. I tried to use the Neo4jSessionFactory class, but it doesn't work for my OGM version. I am using OGM 3.1.1