facile-it/doctrine-mysql-come-back
Auto reconnect on Doctrine MySql has gone away exceptions on doctrine/dbal
3.0.3
3.4M downloads/mo
#3068 most downloaded on Packagist
facile-it/doctrine-mysql-come-back
What this package is like to depend on
Last release 11 months ago
02 Sep 2025
Release timing varies
gaps range from 4 weeks to 1.2 years
Some releases are documented
notes for 15 of 26 stable releases
Nothing withdrawn
no release was ever pulled
12 years old
31 releases · first in 2014
2 releases in the last 12 months
see the full history below
Release timeline
30 releases · Aug 2014 to Sep 2025Releases
latest 31-
3.0.302 Sep 2025Release notes
Open source →- Intercept new timeout message in MySQL 8.0.24+ under PHP 8.4+ (thanks @ackermannd)
- Test against PHP 8.5
Release notes
Open source →- Intercept new timeout message in MySQL 8.0.24+ under PHP 8.4+ (thanks @ackermannd)
- Test against PHP 8.5
-
3.0.215 Mar 2025 -
3.0.113 Mar 2025Release notes
Open source →- Fixed
beginTransactionreconnection behavior with MySQLi and DBAL 4.2.3+
Release notes
Open source →- Fixed
beginTransactionreconnection behavior with MySQLi and DBAL 4.2.3+
- Fixed
-
3.0.010 Mar 2024Release notes
Open source →This new major version is identical to the previous one; the only changes are the ones needed to maintain compatibility with the new DBAL major, so mainly signature changes.
Added
- Support DBAL 4
Removed
- Drop support for DBAL 3
New Contributors
- @oleg-andreyev made their first contribution in #84
Full Changelog: 2.0.0...3.0.0
Release notes
Open source →This new major version is identical to the previous one; the only changes are the ones needed to maintain compatibility with the new DBAL major, so mainly signature changes.
Added
- Support DBAL 4
Removed
- Drop support for DBAL 3
-
2.1.002 Sep 2025Release notes
Open source →- Bump minimum PHP version to 8.1
- Intercept new timeout message in MySQL 8.0.24+ under PHP 8.4+ (thanks @ackermannd)
- Test against PHP 8.5
-
2.0.222 Apr 2025 -
2.0.115 Mar 2025 -
2.0.008 Jun 2023Release notes
Open source →This is the final, stable release of the new version of this library, supporting DBAL 3.6+; unfortunately, DBAL 3.0 to 3.5 is unsupported (but upgrading to 3.6 should not be an issue).
If you're upgrading from a 1.x version, please refer to the UPGRADE-2.0.md document.
The version has no changes from 2.0.0-BETA4; the following is the detailed changelog from the 1.x series:
Added
- Support DBAL v3.6+
- Add
GoneAwayDetectorinterface andMySQLGoneAwayDetectorclass implementation - Add
setGoneAwayDetectormethod to the connections - Add handling of AWS MySQL RDS connection loss
- Add validation to
x_reconnect_attempts - Add mutation testing with Infection
Changed
- Change
Connectionmethod signatures to follow DBAL v3 changes:
namespace Facile\DoctrineMySQLComeBack\Doctrine\DBAL; use Doctrine\DBAL\Cache\QueryCacheProfile; use Doctrine\DBAL\Connection as DBALConnection; +use Doctrine\DBAL\Result; class Connection extends DBALConnection { // ... - public function prepare($sql) + public function prepare(string $sql): DBALStatement // ... - public function executeQuery($query, array $params = array(), $types = array(), QueryCacheProfile $qcp = null) + public function executeQuery(string $sql, array $params = [], $types = [], ?QueryCacheProfile $qcp = null): Result // ... }
- Change
Statementconstructor and method signatures to follow DBAL v3 changes:
namespace Facile\DoctrineMySQLComeBack\Doctrine\DBAL; use Doctrine\DBAL\Cache\QueryCacheProfile; use Doctrine\DBAL\Connection as DBALConnection; +use Doctrine\DBAL\Result; class Statement extends \Doctrine\DBAL\Statement { // ... - public function __construct($sql, ConnectionInterface $conn) + public function __construct(Connection $retriableConnection, Driver\Statement $statement, string $sql) // ... - public function executeQuery($query, array $params = array(), $types = array(), QueryCacheProfile $qcp = null) + public function executeQuery(string $sql, array $params = [], $types = [], ?QueryCacheProfile $qcp = null): Result // ... }
Fixed
- In
PrimaryReadReplicaConnection, fetchdriverOptionsfrom under theprimarykey
Removed
- Drop support for DBAL v2
- Drop support for PHP 7.3
- Removed
Facile\DoctrineMySQLComeBack\Doctrine\DBAL\Connections\MasterSlaveConnectionclass - Removed
Facile\DoctrineMySQLComeBack\Doctrine\DBAL\Driver\ServerGoneAwayExceptionsAwareInterfaceinterface - Removed
Facile\DoctrineMySQLComeBack\Doctrine\DBAL\Driver\ServerGoneAwayExceptionsAwareTraittrait - Removed
Facile\DoctrineMySQLComeBack\Doctrine\DBAL\Driver\Mysqli\Driverclass - Removed
Facile\DoctrineMySQLComeBack\Doctrine\DBAL\Driver\PDOMySQL\Driverclass - Removed
Facile\DoctrineMySQLComeBack\Doctrine\DBAL\Driver\PDO\MySQL\Driverclass - Removed
Connection::query()method (due to drop in DBAL v3) - Removed
Connection::refresh()method (due to drop in DBAL v3) - Removed
Connection::isUpdateQuery()method (logic is now behind theGoneAwayDetectorinterface) - Removed
Statement::bindValue()method - Removed
Statement::bindParam()method - Removed
Statement::execute()method - Removed
Statement::setFetchMode()method
Release notes
Open source →This is the final, stable release of the new version of this library, supporting DBAL 3.6+; unfortunately, DBAL 3.0 to 3.5 is unsupported (but upgrading to 3.6 should not be an issue).
If you're upgrading from a 1.x version, please refer to the UPGRADE-2.0.md document.
The version has no changes from 2.0.0-BETA4; the following is the detailed changelog from the 1.x series:
Added
- Support DBAL v3.6+
- Add
GoneAwayDetectorinterface andMySQLGoneAwayDetectorclass implementation - Add
setGoneAwayDetectormethod to the connections - Add handling of AWS MySQL RDS connection loss
- Add validation to
x_reconnect_attempts - Add mutation testing with Infection
Changed
- Change
Connectionmethod signatures to follow DBAL v3 changes:
namespace Facile\DoctrineMySQLComeBack\Doctrine\DBAL; use Doctrine\DBAL\Cache\QueryCacheProfile; use Doctrine\DBAL\Connection as DBALConnection; +use Doctrine\DBAL\Result; class Connection extends DBALConnection { // ... - public function prepare($sql) + public function prepare(string $sql): DBALStatement // ... - public function executeQuery($query, array $params = array(), $types = array(), QueryCacheProfile $qcp = null) + public function executeQuery(string $sql, array $params = [], $types = [], ?QueryCacheProfile $qcp = null): Result // ... }- Change
Statementconstructor and method signatures to follow DBAL v3 changes:
namespace Facile\DoctrineMySQLComeBack\Doctrine\DBAL; use Doctrine\DBAL\Cache\QueryCacheProfile; use Doctrine\DBAL\Connection as DBALConnection; +use Doctrine\DBAL\Result; class Statement extends \Doctrine\DBAL\Statement { // ... - public function __construct($sql, ConnectionInterface $conn) + public function __construct(Connection $retriableConnection, Driver\Statement $statement, string $sql) // ... - public function executeQuery($query, array $params = array(), $types = array(), QueryCacheProfile $qcp = null) + public function executeQuery(string $sql, array $params = [], $types = [], ?QueryCacheProfile $qcp = null): Result // ... }Fixed
- In
PrimaryReadReplicaConnection, fetchdriverOptionsfrom under theprimarykey
Removed
- Drop support for DBAL v2
- Drop support for PHP 7.3
- Removed
Facile\DoctrineMySQLComeBack\Doctrine\DBAL\Connections\MasterSlaveConnectionclass - Removed
Facile\DoctrineMySQLComeBack\Doctrine\DBAL\Driver\ServerGoneAwayExceptionsAwareInterfaceinterface - Removed
Facile\DoctrineMySQLComeBack\Doctrine\DBAL\Driver\ServerGoneAwayExceptionsAwareTraittrait - Removed
Facile\DoctrineMySQLComeBack\Doctrine\DBAL\Driver\Mysqli\Driverclass - Removed
Facile\DoctrineMySQLComeBack\Doctrine\DBAL\Driver\PDOMySQL\Driverclass - Removed
Facile\DoctrineMySQLComeBack\Doctrine\DBAL\Driver\PDO\MySQL\Driverclass - Removed
Connection::query()method (due to drop in DBAL v3) - Removed
Connection::refresh()method (due to drop in DBAL v3) - Removed
Connection::isUpdateQuery()method (logic is now behind theGoneAwayDetectorinterface) - Removed
Statement::bindValue()method - Removed
Statement::bindParam()method - Removed
Statement::execute()method - Removed
Statement::setFetchMode()method
-
2.0.0-BETA405 Apr 2023 pre-releaseRelease notes
Open source →Added
- Centralize reconnect attempts counter
- Add
Statement::fromDBALStatementfor simpler creation - Add mutation testing with Infection
Fixed
- Avoid reconnection attempts if a transaction was opened (and not closed) before the "gone away" error
- Avoid retrying
SAVEPOINTstatements - Handle
Statement::bindParamandStatement::bindValuecorrectly on reconnection
Changed
- Refactor
Connectionretry logic into a single method - Make
Statement::__constructprivate
Release notes
Open source →Added
- Centralize reconnect attempts counter
- Add
Statement::fromDBALStatementfor simpler creation - Add mutation testing with Infection
Fixed
- Avoid reconnection attempts if a transaction was opened (and not closed) before the "gone away" error
- Avoid retrying
SAVEPOINTstatements - Handle
Statement::bindParamandStatement::bindValuecorrectly on reconnection
Changed
- Refactor
Connectionretry logic into a single method - Make
Statement::__constructprivate
-
2.0.0-BETA301 Apr 2023 pre-releaseRelease notes
Open source →Added
- Add validation to
x_reconnect_attempts
Fixed
- In
PrimaryReadReplicaConnection, fetchdriverOptionsfrom under theprimarykey
Release notes
Open source →Added
- Add validation to
x_reconnect_attempts
Fixed
- In
PrimaryReadReplicaConnection, fetchdriverOptionsfrom under theprimarykey
- Add validation to
-
2.0.0-BETA201 Apr 2023 pre-releaseRelease notes
Open source →Added
- Added
PrimaryReadReplicaConnectionandConnectionTraitback - Added handling of AWS MySQL RDS connection loss
Fixed
- Fixed
beginTransactionfunction to have reconnection support
Removed
- Drop support for DBAL < 3.6
- Drop support for PHP 7.3
- Added
-
2.0.0-BETA123 Jun 2022 pre-releaseRelease notes
Open source →Added
- Support DBAL v3
- Add
GoneAwayDetectorinterface andMySQLGoneAwayDetectorclass implementation
Changed
- Changed
Connectionconstructor and method signatures to follow DBAL v3 changes
Removed
- Drop support for DBAL v2
- Removed Driver classes
- Removed
ConnectionTrait, now everything is insideConnection - Removed
Connection::refresh()method (due to drop in DBAL v3) - Removed
Connection::isUpdateQuery()method (logic is now behind theGoneAwayDetectorinterface) - Removed specialized
MasterSlaveConnectionandPrimaryReadReplicaConnection(due to drop of corresponding classes in DBAL v3)
-
1.10.123 Apr 2021Nothing published for this version
-
1.10.025 Mar 2021Release notes
Open source →Added
- Added PHP 8 support
- Added compatibility with doctrine/dbal > 2.11 Statement
- Added ability to reconnect when creating
Mysqlistatement
Changed
Statementnow extends the original one, so all methods are implemented nowConnection::refresh()is deprecated, you should use the originalConnection::ping()
-
v1.10.0-beta107 Jan 2021 pre-releaseNothing published for this version
-
v1.9.031 Oct 2020Release notes
Open source →Added
- Added compatibility with doctrine/dbal 2.11
- Added Github Actions for CI
Changed
- Bumped minimum PHP version to 7.3
- Updated dependencies
- Added functional tests
Fixed
- Fixed compatiblity with doctrine/dbal 2.11
-
v1.6.520 Apr 2018Release notes
Open source →Changed
- Changed the version constraint of
doctrine/dbalto^2.3to allow v2.7 (#26)
- Changed the version constraint of
-
v1.6.401 Sep 2017Release notes
Open source →Added
- Compatibility with doctrine/dbal up to version 2.6 (#22)
Changed
- Bumped minimum PHP version to 5.6 (#21)
- Updated various dev dependecies
- Simplified the Travis CI build matrix
-
v1.6.330 Sep 2016Release notes
Open source →Added
- Added a test suite
Fixed
- Fix issue for not retrying a query that has a new line after the
SELECTkeyword (#19) - Avoid retrying
UPDATEqueries to avoid issues (#17)
-
v1.6.203 Jun 2016Release notes
Open source →Added
- Added a test suite (#16)
- Added a configuration example for ZendFramework (#13)
Fixed
- Fix issue with
Driver::connect()(#14)
-
v1.6.116 May 2016Release notes
Open source →Added
- Add support for MySQLi (#9)
Changed
- Refactor and eliminate duplication using a trait
Fixed
- Explicit the requirement for PHP >= 5.4
-
v1.5.310 Nov 2015Nothing published for this version
-
v1.5.202 Apr 2015Nothing published for this version
-
v1.5.1no dateNothing published for this version
-
v1.805 Sep 2019Nothing published for this version
-
v1.705 Feb 2019Nothing published for this version
-
v1.626 Nov 2015Nothing published for this version
-
v1.527 Feb 2015Nothing published for this version
-
v1.415 Dec 2014Nothing published for this version
-
v1.316 Oct 2014Nothing published for this version
-
v1.221 Aug 2014Nothing published for this version