From 7caf2237ac9b4e3ddf00122942fe649581196603 Mon Sep 17 00:00:00 2001 From: Nigel Small Date: Tue, 19 Sep 2017 10:12:09 +0100 Subject: [PATCH] withMaxIdleSessions->withMaxIdleConnections --- .../main/java/org/neo4j/driver/v1/Config.java | 16 ++++++++++++++++ .../org/neo4j/driver/v1/util/cc/Cluster.java | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/driver/src/main/java/org/neo4j/driver/v1/Config.java b/driver/src/main/java/org/neo4j/driver/v1/Config.java index b638d51cff..a492e19222 100644 --- a/driver/src/main/java/org/neo4j/driver/v1/Config.java +++ b/driver/src/main/java/org/neo4j/driver/v1/Config.java @@ -315,13 +315,29 @@ public ConfigBuilder withMaxSessions( int size ) * * @param size the max number of idle sessions to keep open * @return this builder + * @deprecated please use {@link #withMaxIdleConnections(int)} instead. */ + @Deprecated public ConfigBuilder withMaxIdleSessions( int size ) { this.maxIdleConnectionPoolSize = size; return this; } + /** + * The max number of idle connections to keep open at once. Configure this + * higher for greater concurrency, or lower to reduce the pressure on the + * database instance. + * + * @param size the max number of idle connections to keep open + * @return this builder + */ + public ConfigBuilder withMaxIdleConnections( int size ) + { + this.maxIdleConnectionPoolSize = size; + return this; + } + /** * Please use {@link #withConnectionLivenessCheckTimeout(long, TimeUnit)}. * diff --git a/driver/src/test/java/org/neo4j/driver/v1/util/cc/Cluster.java b/driver/src/test/java/org/neo4j/driver/v1/util/cc/Cluster.java index 8b2eca6efe..2a6ce0f6b0 100644 --- a/driver/src/test/java/org/neo4j/driver/v1/util/cc/Cluster.java +++ b/driver/src/test/java/org/neo4j/driver/v1/util/cc/Cluster.java @@ -417,7 +417,7 @@ private static Config driverConfig() return Config.build() .withTrustStrategy( trustAllCertificates() ) .withEncryption() - .withMaxIdleSessions( 1 ) + .withMaxIdleConnections( 1 ) .withConnectionLivenessCheckTimeout( 1, TimeUnit.HOURS ) .toConfig(); }