Limits: Understanding Apex SOQL connection pool scaling with concurrent transactions
24K reputation · 15 Jan 2022, 17:31 UTC
Goal: Clarify whether the Apex runtime’s shared database connection pool, which is consumed one connection per SOQL query, adjusts its capacity based on the number of concurrent transactions or remains a fixed org‑wide allocation.
Context: Each synchronous Apex transaction is limited to 100 SOQL queries, each query borrowing a connection from the pool; the pool is released only when the transaction ends. Asynchronous executions (Batch, Queueable, Future) have independent limits and pool usage per chunk. Documentation notes that exceeding the SOQL limit can appear as intermittent connection pool exhaustion but does not specify whether the pool size scales with load or is static.
- Does the connection pool size increase automatically when more synchronous transactions run concurrently?
- Is the pool size a predetermined org‑wide constant that cannot be altered via configuration?
- Are there any observable metrics or logs that reveal dynamic scaling versus a fixed capacity?