All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
- ...
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.
- Support DBAL 4
- Drop support for DBAL 3
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:
- Support DBAL v3.6+
- Add
GoneAwayDetector
interface andMySQLGoneAwayDetector
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
- Change
Connection
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 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
// ...
}
- In
PrimaryReadReplicaConnection
, fetchdriverOptions
from under theprimary
key
- 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 theGoneAwayDetector
interface) - Removed
Statement::bindValue()
method - Removed
Statement::bindParam()
method - Removed
Statement::execute()
method - Removed
Statement::setFetchMode()
method
- Centralize reconnect attempts counter
- Add
Statement::fromDBALStatement
for simpler creation - Add mutation testing with Infection
- Avoid reconnection attempts if a transaction was opened (and not closed) before the "gone away" error
- Avoid retrying
SAVEPOINT
statements - Handle
Statement::bindParam
andStatement::bindValue
correctly on reconnection
- Refactor
Connection
retry logic into a single method - Make
Statement::__construct
private
- Add validation to
x_reconnect_attempts
- In
PrimaryReadReplicaConnection
, fetchdriverOptions
from under theprimary
key
- Added
PrimaryReadReplicaConnection
andConnectionTrait
back - Added handling of AWS MySQL RDS connection loss
- Fixed
beginTransaction
function to have reconnection support
- Drop support for DBAL < 3.6
- Drop support for PHP 7.3
- Support DBAL v3
- Add
GoneAwayDetector
interface andMySQLGoneAwayDetector
class implementation
- Changed
Connection
constructor and method signatures to follow DBAL v3 changes
- 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 theGoneAwayDetector
interface) - Removed specialized
MasterSlaveConnection
andPrimaryReadReplicaConnection
(due to drop of corresponding classes in DBAL v3)
- Added PHP 8 support
- Added compatibility with doctrine/dbal > 2.11 Statement
- Added ability to reconnect when creating
Mysqli
statement
Statement
now extends the original one, so all methods are implemented nowConnection::refresh()
is deprecated, you should use the originalConnection::ping()
- Added compatibility with doctrine/dbal 2.11
- Added Github Actions for CI
- Bumped minimum PHP version to 7.3
- Updated dependencies
- Added functional tests
- Fixed compatiblity with doctrine/dbal 2.11
- Fixed issue about loss of state for Statement class on retry (#34)
- Added DBAL's MasterSlaveConnection support (#33)
- Compatibility with doctrine/dbal up to version 2.9 (#32)
- Changed the version constraint of
doctrine/dbal
to^2.3
to allow v2.7 (#26)
- Compatibility with doctrine/dbal up to version 2.6 (#22)
- Bumped minimum PHP version to 5.6 (#21)
- Updated various dev dependecies
- Simplified the Travis CI build matrix
- Added a test suite
- 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)
- Added a test suite (#16)
- Added a configuration example for ZendFramework (#13)
- Fix issue with
Driver::connect()
(#14)
- Add support for MySQLi (#9)
- Refactor and eliminate duplication using a trait
- Explicit the requirement for PHP >= 5.4
- Create the
ServerGoneAwayExceptionsAwareInterface
- Handle correctly the retrying of
beginTransaction()