nalogka/doctrine-reconnect-bundle
A Symfony bundle for Doctrine that automatically detects lost database connections and reconnects them, helping long-running workers, consumers, and console commands recover from stale or dropped connections without manual intervention.
Architecture fit
Bundle class plus a DI extension/compiler pass, which has no direct analogue in Laravel's service-provider model. It cannot be installed and used as-is in a Laravel application.2006 server has gone away, 2013 lost connection, Postgres terminating connection) and re-establishes it before/on the next query.laravel-doctrine/orm or DBAL directly. A standard Eloquent-only Laravel app gets no architectural fit at all — the equivalent capability already exists via DB::reconnect(), DB::purge(), and Octane's connection-reset listeners.Integration feasibility
composer.json constraints (PHP, doctrine/dbal 3.x vs 4.x, symfony/* 5/6/7), whether it targets Doctrine\DBAL\Connection or the older Doctrine\DBAL\Driver, and whether it relies on Symfony events that Laravel does not dispatch.Technical risk
Connection::isTransactionActive() is true and instead surface the error.wait_timeout, max_lifetime, TCP keepalives, or the pooler, not by retry logic.Key questions
Connection decorator? Does the same instance stay registered in the container, or does it need a wrapper?PrimaryReadReplicaConnection) and prepared-statement/statement-cache invalidation?Stack fit
JobProcessing/Looping listener, or rely on DB::reconnect() before each job.RequestTerminated/TaskTerminated listeners.DB::reconnect() at the top of each batch iteration.ReconnectServiceProvider that decorates Doctrine\DBAL\Connection and exposes the same guard.Migration path
app/Support/Doctrine/Reconnect (or an internal Composer path repo) with attribution and the original license. Strip all Symfony DI code.nalogka/doctrine-reconnect-bundle out of composer.json entirely so upstream deletion cannot break our build.Compatibility
Connection internals materially versus 3.x, and a bundle last touched on DBAL 3 will not port cleanly.Sequencing
Maintenance
Support
Scaling
max_connections.Failure modes
wait_timeout never gets fixed because the app "self-heals."Ramp-up
DB::reconnect() and lifecycle events.How can I help you explore Laravel packages today?