Answer: The AdapterPool is experimental and may be removed in the next major release (v4); no deprecation notices have been issued yet.
Confirmed facts from Laminas Db v3
- Requires PHP ≥8.0 and drops all
Zend\Db namespace aliases; classes reside under Laminas\Db\Adapter only.
- The
AdapterPoolFactory now expects a Psr\Container\ContainerInterface; the old factory Laminas\Db\Adapter\AdapterServiceFactory is removed.
- Configuration keys must be under
laminas-db; the legacy zend-db section is ignored.
Likely explanation for breaking changes
If your application still references Zend\Db\Adapter\Adapter (via service manager lookup, type‑hints, or direct instantiation) or uses the old zend-db configuration, the container will fail to resolve the pool after upgrading to v3, resulting in a ServiceNotFoundException or ClassNotFoundException. The pool’s size cannot be changed at runtime and it lacks thread‑safety, which further limits its suitability for production workloads.
Steps to verify compatibility and prepare for future removal
- Upgrade:
composer require laminas/laminas-db:^3.0 --update-with-dependencies
- Confirm PHP version:
php -v must show 8.0 or higher.
- Migrate configuration: rename any
zend-db sections to laminas-db and ensure factory definitions use Psr\Container\ContainerInterface.
- Update code: replace
Zend\Db\Adapter\Adapter with Laminas\Db\Adapter\Adapter (or add a class alias loader if you cannot change all references).
- Test: retrieve the pool from the container and iterate over it; no exceptions indicate the pool still works in v3.
Missing diagnostic detail: Are you obtaining the AdapterPool through the service manager or by instantiating it directly? Knowing this tells you whether you need to adjust configuration (service‑manager path) or class names/instantiations (direct‑use path).
Recommendation for connection pooling
Because the pool is marked experimental and may be dropped in v4, consider migrating to a dedicated pooling solution such as:
- Doctrine DBAL’s
ConnectionPool (works with any PDO driver).
- A lightweight wrapper around
Laminas\Db\Adapter\Adapter using SplObjectStorage or a generic PSR‑11 pool.
- Using a reverse‑proxy or application‑level pool (e.g.,
ramsey/collection or php-http/pool) if your workload allows.
Adopting one of these now will avoid a breaking change when the experimental pool is eventually removed.