Class ConnectionPoolProperties.Builder
java.lang.Object
de.xima.fc.persistence.ConnectionPoolProperties.Builder
- Enclosing class:
ConnectionPoolProperties
- Since:
- 8.5.0
- Author:
- Norman Lorenz, Michael Kohlsche
-
Method Summary
Modifier and TypeMethodDescriptionbuild()connectionTimeoutMs(long connectionTimeoutMs) The maximum amount of time (in milliseconds) that a client will wait for a connection from the pool.idleTimeoutMs(long idleTimeoutMs) The maximum amount of time (in milliseconds) that a connection is allowed to sit idle in the connection pool.leakDetectionThresholdMs(long leakDetectionThresholdMs) This property controls the amount of time that a connection can be out of the pool before a message is logged indicating a possible connection leak.maxConnections(int maxConnections) The maximum number of connections allowed in the connection pool.maxLifetimeMs(long maxLifetimeMs) This property controls the maximum lifetime of a connection in the pool.minimumIdleConnections(int minimumIdleConnections) The minimum number of idle connections that the connection pool tries to maintain.toString()validationTimeoutMs(long validationTimeoutMs) The maximum amount of time (in milliseconds) that a connection will be tested for validity.
-
Method Details
-
maxConnections
The maximum number of connections allowed in the connection pool. If null, the default value from the system connection pool configuration will be used. default: 1- Returns:
this.
-
minimumIdleConnections
The minimum number of idle connections that the connection pool tries to maintain. If the pool has fewer idle connections than this value, it will make an effort to create new idle connections. default: 0- Returns:
this.
-
idleTimeoutMs
The maximum amount of time (in milliseconds) that a connection is allowed to sit idle in the connection pool. When a connection reaches this timeout, it will be retired from the pool. An in-use connection will never be retired, only when it is idle will it be removed. default: 200000 (200 seconds)- Returns:
this.
-
connectionTimeoutMs
The maximum amount of time (in milliseconds) that a client will wait for a connection from the pool. If this time is exceeded without a connection becoming available, a SQLException will be thrown fromDataSource.getConnection(). default: 30000 (30 seconds)- Returns:
this.
-
validationTimeoutMs
The maximum amount of time (in milliseconds) that a connection will be tested for validity. This is used when a connection is retrieved from the pool or a connection test is performed. If the connection does not respond within this time, it will be considered invalid and will be retired from the pool. default: 5000 (5 seconds)- Returns:
this.
-
leakDetectionThresholdMs
This property controls the amount of time that a connection can be out of the pool before a message is logged indicating a possible connection leak. A value of 0 means leak detection is disabled. default: 0 (disabled)- Returns:
this.
-
maxLifetimeMs
This property controls the maximum lifetime of a connection in the pool. When a connection reaches this timeout, even if recently used, it will be retired from the pool. An in-use connection will never be retired, only when it is idle will it be removed. default: 1800000 (30 minutes)- Returns:
this.
-
build
-
toString
-