/**
* @param array|null $params
*
* @return bool
*
* @throws \Exception
*/
public function execute($params = null)
{
$stmt = null;
$attempt = 0;
$retry = true;
while ($retry) {
$retry = false;
try {
$stmt = $this->stmt->execute($params);
} catch (\Exception $e) {
if ($this->conn->canTryAgain($attempt) && $this->conn->isRetryableException($e, $this->sql)) {
$this->conn->close();
$this->createStatement();
++$attempt;
$retry = true;
} else {
throw $e;
}
}
}
return $stmt;
}