From 3a990adb81d3047c45e49be75926b910b0df917d Mon Sep 17 00:00:00 2001 From: jackdpeterson Date: Mon, 27 Jun 2016 08:13:02 -0700 Subject: [PATCH] It appears that the intended functionality here is to not attempt a reconnect if a Doctrine transaction is nested. As such, I'm flipping this to use the method that does the checking (count of transactions > 0) to check if the transaction is active. If so, it seems like we would need to immediately throw a nested transaction error where the count of incremented transactional items has not been decremented back down to 0 -- This is related to issue #1 --- src/DBAL/Connection.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/DBAL/Connection.php b/src/DBAL/Connection.php index 12acab7..c63d741 100644 --- a/src/DBAL/Connection.php +++ b/src/DBAL/Connection.php @@ -192,11 +192,9 @@ public function prepareUnwrapped($sql) */ public function validateReconnectAttempt(DBALException $e, $attempt) { -/** removing to test and see if this resolves the issue at hand - if (!$this->getTransactionNestingLevel()) { - return false; - }**/ - + if ($this->isTransactionActive()) { + return false; + } if ($this->reconnectAttempts && $attempt < $this->reconnectAttempts) { $reconnectExceptions = $this->_driver->getReconnectExceptions(); $message = $e->getMessage();