Download the PHP package facile-it/doctrine-mysql-come-back without Composer
On this page you can find all versions of the php package facile-it/doctrine-mysql-come-back. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
More information about facile-it/doctrine-mysql-come-back
Files in facile-it/doctrine-mysql-come-back
Informations about the package doctrine-mysql-come-back
Auto reconnect on Doctrine MySql has gone away exceptions on
If you're using DBAL 3
If you're using DBAL
In order to use DoctrineMySQLComeBack you have to set the
wrapperClass connection parameter.
You can choose how many times Doctrine should be able to reconnect, setting
x_reconnect_attempts driver option. Its value should be an int.
If you're using DBAL v2, you also need to set the
driverClass parameter too; please refer to the previous version of this readme for that.
An example of configuration at connection instantiation time:
An example of yaml configuration on Symfony projects:
An example of configuration on Laminas Framework 2projects:
You can use wrapper class
Facile\DoctrineMySQLComeBack\Doctrine\DBAL\Connections\MasterSlaveConnection if you are using master / slave Doctrine configuration.
Since DBAL v3,
Connection::refresh does not exist anymore, so you don't need to do anything else to leverage the reconnection, it will be automagically done.
v1.6 of this library automagically reconnection is enabled also during
and this works also during simple
$em->flush(), if out of a previous transaction.
Thanks to Dieter Peeters and his proposal on DBAL-275. Check it out if you are using doctrine/dbal <2.3.