From e295011736ff11e88e8b131a3c716cfb9dfa2830 Mon Sep 17 00:00:00 2001 From: Gerrit Meier Date: Tue, 10 Oct 2023 15:48:40 +0200 Subject: [PATCH] Make session related config not reconfigure the driver. There is now a BoltDriver#configureSessionConfig method in place that does only touch the session related config. --- .../neo4j/ogm/drivers/bolt/driver/BoltDriver.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/bolt-driver/src/main/java/org/neo4j/ogm/drivers/bolt/driver/BoltDriver.java b/bolt-driver/src/main/java/org/neo4j/ogm/drivers/bolt/driver/BoltDriver.java index dcbb42795..1acd7affe 100644 --- a/bolt-driver/src/main/java/org/neo4j/ogm/drivers/bolt/driver/BoltDriver.java +++ b/bolt-driver/src/main/java/org/neo4j/ogm/drivers/bolt/driver/BoltDriver.java @@ -123,15 +123,20 @@ public void configure(Configuration newConfiguration) { this.driverConfig = buildDriverConfig(); this.credentials = this.configuration.getCredentials(); - this.database = this.configuration.getDatabase(); - this.databaseSelectionProvider = this.configuration.getDatabaseSelectionProvider(); - this.userSelectionProvider = this.configuration.getUserSelectionProvider(); - + configureSessionConfig(newConfiguration); if (this.configuration.getVerifyConnection()) { checkDriverInitialized(); } } + public void configureSessionConfig(Configuration newConfiguration) { + // since it is still possible that the BoltDriver will get recreated, we have to persist the given config + this.configuration = newConfiguration; + this.database = this.configuration.getDatabase(); + this.databaseSelectionProvider = this.configuration.getDatabaseSelectionProvider(); + this.userSelectionProvider = this.configuration.getUserSelectionProvider(); + } + @Override protected String getTypeSystemName() { return "org.neo4j.ogm.drivers.bolt.types.BoltNativeTypes";