Pool Config
Configuration for SuspendConnectionPool.
All durations use kotlin.time.Duration. All validations in init are intentionally strict — it is better to fail fast with a clear message than to produce a pool with pathological behaviour at runtime.
Constructors
Properties
Maximum time to wait for a free connection when the pool is saturated. On timeout, SuspendConnectionPool.use throws PoolAcquireTimeoutException.
How often the background cleanup coroutine runs idle/lifetime sweeps. Smaller values release dead connections sooner at the cost of more wake-ups.
A connection that has been idle longer than this is eligible for eviction by the background cleanup coroutine. Connections down to minConnections are always preserved, regardless of idle time.
Hard upper bound on concurrent connections. A caller that tries to acquire when the pool is saturated will suspend (not block a thread) until another caller releases or acquireTimeout elapses.
Absolute lifetime of a connection from creation to forced retirement, regardless of activity. Prevents long-lived sessions from accumulating server-side state (prepared statement cache growth, session-level temp tables, etc.). Set to Duration.INFINITE to disable max-lifetime retirement.
Minimum number of connections kept open in the pool at all times, even when idle. The pool pre-populates to this size on first use. Set to 0 to disable warm-up.
Graceful-shutdown grace period. When SuspendConnectionPool.close is invoked the pool stops accepting new acquires and waits up to this long for in-flight use { } blocks to return their connections before forcibly closing what remains.
Skip validation for connections released within this window. A just-returned connection is very likely still alive; validating every borrow wastes round-trips.
Optional SQL that validates a connection before handing it to a caller. If null, no validation is performed — the pool relies on SuspendConnectionPool.use to evict connections that raise errors during use. Typical values: "SELECT 1" (most databases), "SELECT 1 FROM DUAL" (Oracle).