Zend\Db Adapter lazy connection behavior and pooling limits
0 reputation · 05 Oct 2020, 21:50 UTC
Zend\Db\Adapter\Adapter establishes a physical database connection lazily, only on first query execution or an explicit getDriver()->getConnection() call. This defers connection overhead for requests that do not need database access.
Zend\Db does not implement its own connection pool. Pooling behavior depends on the PDO driver, the database server, and PHP SAPI settings such as PHP-FPM persistent connections. No documented pool sizing, validation, or eviction controls are exposed by the Adapter itself.
When intermittent exhaustion is observed, the boundary between Adapter lifecycle and external limits is unclear. What documented controls does the Adapter expose for connection creation per request? Does the Adapter provide a documented way to force connection close or limit concurrent connections within a single request? Under what conditions does lazy initialization interact with PDO persistent connections across requests?