JDBC Connection Pool Exhaustion: Need Clarity on Connection Idle Timeout Settings
0 reputation · 21 May 2023, 05:23 UTC
0 reputation · 21 May 2023, 05:23 UTC
Oracle Fusion Middleware uses WebLogic Server’s JDBC connection pool. When idle connections are not returned or the pool’s max capacity is too low for traffic spikes, the pool can exhaust, causing intermittent application failures. Default validation uses "SELECT 1 FROM DUAL" and there is no auto‑scaling; administrators manually adjust Max Capacity or enable newer dynamic pooling features.
The product documentation does not specify how to configure the Connection Idle Timeout for long‑running batch jobs, leaving uncertainty whether idle connections should be closed aggressively or kept alive to avoid exhaustion during peak periods.
35275 reputation · 21 May 2023, 10:12 UTC
For long-running batch jobs on Oracle WebLogic JDBC pools, set Inactive Connection Timeout to 300-600 seconds, or slightly less than the expected idle gap between batch runs. Do not use an aggressive timeout below ~30 seconds and avoid keeping idle connections for >1800 seconds during low traffic.
Coupling the timeout with validation on reserve is recommended: enable Test Connections on Reserve with a lightweight query such as SELECT 1 FROM DUAL and keep Test Connections on Return off for batch workloads. This discards stale connections that the database or network may have closed while idle.
Idle timeout does not change WebLogic licensing in 12c or 14c. Memory use scales with the number of idle connections retained, not with the timeout value itself. Each retained physical connection holds a small heap footprint for pool bookkeeping and socket state.
Assumption: your pool is a standard WebLogic JDBC Data Source without dynamic scaling enabled. If dynamic pooling is enabled, behavior differs.
Optional safe verification: enable verbose JDBC logging temporarily with -Dweblogic.jdbc.verbose=true to observe checkout/checkin and close events. Disable after verification.
The optimal timeout depends on the database server's own idle session timeout and the exact batch interval. If you can share the database's session idle timeout and the expected gap between batch runs, the recommendation can be tightened to avoid DB-side closes while still freeing pool capacity.
Use comments to ask for clarification. Post a solution as an answer.
35,275 reputation · 21 May 2023, 12:19 UTC
One clarification worth adding: WebLogic's InactiveConnectionTimeoutSeconds, paired with ShrinkFrequencySeconds, applies only to connections sitting unallocated in the pool. It cannot reclaim a connection a batch job has checked out and is holding idle. If a long-running job keeps a connection open across a pause, an aggressive idle timeout will shrink only the available pool between requests, not the job's held connection.
For batch processes, derive the timeout from the longest legitimate idle gap between checkout and return, plus margin, and keep it below known database, firewall, or load-balancer idle-kill thresholds. If the job must span pauses, hold one connection deterministically and return it promptly. Before adjusting MaxCapacity, monitor active and current capacity plus waiting-for-connection counts to distinguish a leak from a capacity spike.
Because 12c and 14c can differ in console labels, MBean names, and default pooling behavior, verify the exact settings in your release. Database session limits and licensing are contract-specific, so confirm those before sizing for peak sessions.