Skip to content

Commit 3795190

Browse files
authored
Merge pull request #403 from technige/1.5-config-refactoring
withMaxIdleSessions->withMaxIdleConnections
2 parents 1820906 + 7caf223 commit 3795190

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

driver/src/main/java/org/neo4j/driver/v1/Config.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,13 +315,29 @@ public ConfigBuilder withMaxSessions( int size )
315315
*
316316
* @param size the max number of idle sessions to keep open
317317
* @return this builder
318+
* @deprecated please use {@link #withMaxIdleConnections(int)} instead.
318319
*/
320+
@Deprecated
319321
public ConfigBuilder withMaxIdleSessions( int size )
320322
{
321323
this.maxIdleConnectionPoolSize = size;
322324
return this;
323325
}
324326

327+
/**
328+
* The max number of idle connections to keep open at once. Configure this
329+
* higher for greater concurrency, or lower to reduce the pressure on the
330+
* database instance.
331+
*
332+
* @param size the max number of idle connections to keep open
333+
* @return this builder
334+
*/
335+
public ConfigBuilder withMaxIdleConnections( int size )
336+
{
337+
this.maxIdleConnectionPoolSize = size;
338+
return this;
339+
}
340+
325341
/**
326342
* Please use {@link #withConnectionLivenessCheckTimeout(long, TimeUnit)}.
327343
*

driver/src/test/java/org/neo4j/driver/v1/util/cc/Cluster.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ private static Config driverConfig()
417417
return Config.build()
418418
.withTrustStrategy( trustAllCertificates() )
419419
.withEncryption()
420-
.withMaxIdleSessions( 1 )
420+
.withMaxIdleConnections( 1 )
421421
.withConnectionLivenessCheckTimeout( 1, TimeUnit.HOURS )
422422
.toConfig();
423423
}

0 commit comments

Comments
 (0)