How can i create multiple session for neo4j in java using this driver org.neo4j.driver.v1?
I'm able to create a single session with this instruction:
Driver driver = GraphDatabase.driver( "bolt://localhost", +
AuthTokens.basic(neo4j, password), Config.build()
.withEncryptionLevel( Config.EncryptionLevel.REQUIRED )
.withTrustStrategy( Config.TrustStrategy.trustOnFirstUse( new File( "/path/to/neo4j_known_hosts" ) ) )
.toConfig() );
In your code sample, you're not creating a
Session, only aDriver.The
Sessionis created by callingdriver.session(). If you want multiple sessions, you just call the method multiple times on the sameDriverinstance, e.g. if you're querying Neo4j while handling concurrent HTTP requests in your web application.