PackageTrack
Sign in Get early access

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 2025
2015 2017 2019 2021 2023 2025
Release Pre-release

Releases

latest 31
  1. 3.0.3 02 Sep 2025
    Release notes
    • Intercept new timeout message in MySQL 8.0.24+ under PHP 8.4+ (thanks @ackermannd)
    • Test against PHP 8.5
    Open source →
    Release notes
    • Intercept new timeout message in MySQL 8.0.24+ under PHP 8.4+ (thanks @ackermannd)
    • Test against PHP 8.5
    Open source →
  2. 3.0.2 15 Mar 2025
    Release notes
    • Resolve PHP 8.4 deprecation
    Open source →
    Release notes
    • Resolve PHP 8.4 deprecation
    Open source →
  3. 3.0.1 13 Mar 2025
    Release notes
    • Fixed beginTransaction reconnection behavior with MySQLi and DBAL 4.2.3+
    Open source →
    Release notes
    • Fixed beginTransaction reconnection behavior with MySQLi and DBAL 4.2.3+
    Open source →
  4. 3.0.0 10 Mar 2024
    Release notes

    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

    Full Changelog: 2.0.0...3.0.0

    Open source →
    Release notes

    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
    Open source →
  5. 2.1.0 02 Sep 2025
    Release notes
    • 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
    Open source →
  6. 2.0.2 22 Apr 2025
    Release notes
    • Resolve PHP 8.4 deprecation (fix 2.0.1 tag)
    Open source →
  7. 2.0.1 15 Mar 2025
    Release notes
    • Resolve PHP 8.4 deprecation
    Open source →
  8. 2.0.0 08 Jun 2023
    Release notes

    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 GoneAwayDetector interface and MySQLGoneAwayDetector class implementation
    • Add setGoneAwayDetector method to the connections
    • Add handling of AWS MySQL RDS connection loss
    • Add validation to x_reconnect_attempts
    • Add mutation testing with Infection

    Changed

    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 Statement constructor 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, fetch driverOptions from under the primary key

    Removed

    • Drop support for DBAL v2
    • Drop support for PHP 7.3
    • Removed Facile\DoctrineMySQLComeBack\Doctrine\DBAL\Connections\MasterSlaveConnection class
    • Removed Facile\DoctrineMySQLComeBack\Doctrine\DBAL\Driver\ServerGoneAwayExceptionsAwareInterface interface
    • Removed Facile\DoctrineMySQLComeBack\Doctrine\DBAL\Driver\ServerGoneAwayExceptionsAwareTrait trait
    • Removed Facile\DoctrineMySQLComeBack\Doctrine\DBAL\Driver\Mysqli\Driver class
    • Removed Facile\DoctrineMySQLComeBack\Doctrine\DBAL\Driver\PDOMySQL\Driver class
    • Removed Facile\DoctrineMySQLComeBack\Doctrine\DBAL\Driver\PDO\MySQL\Driver class
    • 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 the GoneAwayDetector interface)
    • Removed Statement::bindValue() method
    • Removed Statement::bindParam() method
    • Removed Statement::execute() method
    • Removed Statement::setFetchMode() method
    Open source →
    Release notes

    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 GoneAwayDetector interface and MySQLGoneAwayDetector class implementation
    • Add setGoneAwayDetector method to the connections
    • Add handling of AWS MySQL RDS connection loss
    • Add validation to x_reconnect_attempts
    • Add mutation testing with Infection

    Changed

    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 Statement constructor 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, fetch driverOptions from under the primary key

    Removed

    • Drop support for DBAL v2
    • Drop support for PHP 7.3
    • Removed Facile\DoctrineMySQLComeBack\Doctrine\DBAL\Connections\MasterSlaveConnection class
    • Removed Facile\DoctrineMySQLComeBack\Doctrine\DBAL\Driver\ServerGoneAwayExceptionsAwareInterface interface
    • Removed Facile\DoctrineMySQLComeBack\Doctrine\DBAL\Driver\ServerGoneAwayExceptionsAwareTrait trait
    • Removed Facile\DoctrineMySQLComeBack\Doctrine\DBAL\Driver\Mysqli\Driver class
    • Removed Facile\DoctrineMySQLComeBack\Doctrine\DBAL\Driver\PDOMySQL\Driver class
    • Removed Facile\DoctrineMySQLComeBack\Doctrine\DBAL\Driver\PDO\MySQL\Driver class
    • 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 the GoneAwayDetector interface)
    • Removed Statement::bindValue() method
    • Removed Statement::bindParam() method
    • Removed Statement::execute() method
    • Removed Statement::setFetchMode() method
    Open source →
  9. 2.0.0-BETA4 05 Apr 2023 pre-release
    Release notes

    Added

    • Centralize reconnect attempts counter
    • Add Statement::fromDBALStatement for 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 SAVEPOINT statements
    • Handle Statement::bindParam and Statement::bindValue correctly on reconnection

    Changed

    • Refactor Connection retry logic into a single method
    • Make Statement::__construct private
    Open source →
    Release notes

    Added

    • Centralize reconnect attempts counter
    • Add Statement::fromDBALStatement for 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 SAVEPOINT statements
    • Handle Statement::bindParam and Statement::bindValue correctly on reconnection

    Changed

    • Refactor Connection retry logic into a single method
    • Make Statement::__construct private
    Open source →
  10. 2.0.0-BETA3 01 Apr 2023 pre-release
    Release notes

    Added

    • Add validation to x_reconnect_attempts

    Fixed

    • In PrimaryReadReplicaConnection, fetch driverOptions from under the primary key
    Open source →
    Release notes

    Added

    • Add validation to x_reconnect_attempts

    Fixed

    • In PrimaryReadReplicaConnection, fetch driverOptions from under the primary key
    Open source →
  11. 2.0.0-BETA2 01 Apr 2023 pre-release
    Release notes

    Added

    • Added PrimaryReadReplicaConnection and ConnectionTrait back
    • Added handling of AWS MySQL RDS connection loss

    Fixed

    • Fixed beginTransaction function to have reconnection support

    Removed

    • Drop support for DBAL < 3.6
    • Drop support for PHP 7.3
    Open source →
  12. 2.0.0-BETA1 23 Jun 2022 pre-release
    Release notes

    Added

    • Support DBAL v3
    • Add GoneAwayDetector interface and MySQLGoneAwayDetector class implementation

    Changed

    • Changed Connection constructor and method signatures to follow DBAL v3 changes

    Removed

    • Drop support for DBAL v2
    • Removed Driver classes
    • Removed ConnectionTrait, now everything is inside Connection
    • Removed Connection::refresh() method (due to drop in DBAL v3)
    • Removed Connection::isUpdateQuery() method (logic is now behind the GoneAwayDetector interface)
    • Removed specialized MasterSlaveConnection and PrimaryReadReplicaConnection (due to drop of corresponding classes in DBAL v3)
    Open source →
  13. 1.10.1 23 Apr 2021

    Nothing published for this version

  14. 1.10.0 25 Mar 2021
    Release notes

    Added

    • Added PHP 8 support
    • Added compatibility with doctrine/dbal > 2.11 Statement
    • Added ability to reconnect when creating Mysqli statement

    Changed

    • Statement now extends the original one, so all methods are implemented now
    • Connection::refresh() is deprecated, you should use the original Connection::ping()
    Open source →
  15. v1.10.0-beta1 07 Jan 2021 pre-release

    Nothing published for this version

  16. v1.9.0 31 Oct 2020
    Release notes

    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
    Open source →
  17. v1.6.5 20 Apr 2018
    Release notes

    Changed

    • Changed the version constraint of doctrine/dbal to ^2.3 to allow v2.7 (#26)
    Open source →
  18. v1.6.4 01 Sep 2017
    Release notes

    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
    Open source →
  19. v1.6.3 30 Sep 2016
    Release notes

    Added

    • Added a test suite

    Fixed

    • Fix issue for not retrying a query that has a new line after the SELECT keyword (#19)
    • Avoid retrying UPDATE queries to avoid issues (#17)
    Open source →
  20. v1.6.2 03 Jun 2016
    Release notes

    Added

    • Added a test suite (#16)
    • Added a configuration example for ZendFramework (#13)

    Fixed

    • Fix issue with Driver::connect() (#14)
    Open source →
  21. v1.6.1 16 May 2016
    Release notes

    Added

    • Add support for MySQLi (#9)

    Changed

    • Refactor and eliminate duplication using a trait

    Fixed

    • Explicit the requirement for PHP >= 5.4
    Open source →
  22. v1.5.3 10 Nov 2015

    Nothing published for this version

  23. v1.5.2 02 Apr 2015

    Nothing published for this version

  24. v1.5.1 no date

    Nothing published for this version

  25. v1.8 05 Sep 2019

    Nothing published for this version

  26. v1.7 05 Feb 2019

    Nothing published for this version

  27. v1.6 26 Nov 2015

    Nothing published for this version

  28. v1.5 27 Feb 2015

    Nothing published for this version

  29. v1.4 15 Dec 2014

    Nothing published for this version

  30. v1.3 16 Oct 2014

    Nothing published for this version

  31. v1.2 21 Aug 2014

    Nothing published for this version

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive