Package de.xima.fc.persistence
Class ConnectionPoolProperties
- java.lang.Object
-
- de.xima.fc.persistence.ConnectionPoolProperties
-
public final class ConnectionPoolProperties extends Object
- Since:
- 8.5.0
- Author:
- Norman Lorenz, Michael Kohlsche
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classConnectionPoolProperties.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ConnectionPoolProperties.Builderbuilder()booleanequals(Object o)longgetConnectionTimeoutMs()The maximum amount of time (in milliseconds) that a client will wait for a connection from the pool.longgetIdleTimeoutMs()The maximum amount of time (in milliseconds) that a connection is allowed to sit idle in the connection pool.longgetLeakDetectionThresholdMs()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.intgetMaxConnections()The maximum number of connections allowed in the connection pool.longgetMaxLifetimeMs()This property controls the maximum lifetime of a connection in the pool.intgetMinimumIdleConnections()The minimum number of idle connections that the connection pool tries to maintain.longgetValidationTimeoutMs()The maximum amount of time (in milliseconds) that a connection will be tested for validity.inthashCode()static ConnectionPoolPropertiessystem()Retrieves the connection pool properties for the system connection, as defined in the server configuration.ConnectionPoolProperties.BuildertoBuilder()StringtoString()
-
-
-
Method Detail
-
system
public static ConnectionPoolProperties system()
Retrieves the connection pool properties for the system connection, as defined in the server configuration. This method is used internally to configure the connection pool for the system database, and can also be used by other components that need to access the system connection properties.- Returns:
- the
ConnectionPoolPropertiesfor the system connection - Throws:
IllegalStateException- if there is no database connection configuration available on this server
-
builder
public static ConnectionPoolProperties.Builder builder()
-
toBuilder
public ConnectionPoolProperties.Builder toBuilder()
-
getMaxConnections
public int getMaxConnections()
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
-
getMinimumIdleConnections
public int getMinimumIdleConnections()
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
-
getIdleTimeoutMs
public long getIdleTimeoutMs()
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)
-
getConnectionTimeoutMs
public long getConnectionTimeoutMs()
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)
-
getValidationTimeoutMs
public long getValidationTimeoutMs()
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)
-
getLeakDetectionThresholdMs
public long getLeakDetectionThresholdMs()
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)
-
getMaxLifetimeMs
public long getMaxLifetimeMs()
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)
-
-