From 290060a87a3ee219833eec5e5650e5fcc14a3bea Mon Sep 17 00:00:00 2001 From: Wolfy-J Date: Tue, 5 Nov 2019 11:46:27 +0300 Subject: [PATCH] - force disconnect in case of connection error --- src/Driver/Driver.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Driver/Driver.php b/src/Driver/Driver.php index 32d86ebd..ca70ebdd 100644 --- a/src/Driver/Driver.php +++ b/src/Driver/Driver.php @@ -296,6 +296,8 @@ public function beginTransaction(string $isolationLevel = null, bool $cacheState $e instanceof StatementException\ConnectionException && $this->options['reconnect'] ) { + $this->disconnect(); + try { return $this->getPDO()->beginTransaction(); } catch (\PDOException $e) { @@ -527,6 +529,8 @@ private function statement(string $query, array $parameters = [], bool $retry = && $this->tScope->getLevel() === 0 && $retry ) { + $this->disconnect(); + // retrying return $this->statement($query, $parameters, false); }