$causes
$causes : array
The list of error strings to match when looking for a disconnection error.
This is a static variable to enable opcache to inline the values.
Makes sure the connection to the database is alive before authorizing the retry of an action.
$connection : \Cake\Database\Connection
The connection to check for validity
__construct(\Cake\Database\Connection $connection)
Creates the ReconnectStrategy object by storing a reference to the passed connection. This reference will be used to automatically reconnect to the server in case of failure.
\Cake\Database\Connection | $connection | The connection to check |
shouldRetry(\Exception $exception, integer $retryCount) : boolean
Checks whether or not the exception was caused by a lost connection, and returns true if it was able to successfully reconnect.
\Exception | $exception | The exception to check for its message |
integer | $retryCount | The number of times the action has been already called |
Whether or not it is OK to retry the action
Loading…