Skip to content

Commit

Permalink
It appears that the intended functionality here is to not attempt a r…
Browse files Browse the repository at this point in the history
…econnect 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 bushbaby#1
  • Loading branch information
jackdpeterson committed Jun 27, 2016
1 parent a84faf4 commit 3a990ad
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/DBAL/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

1 comment on commit 3a990ad

@basz
Copy link

@basz basz commented on 3a990ad Jun 27, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I follow this, makes sense. Transactions aren't supposed to be handled.

Please sign in to comment.