Skip to content

Commit

Permalink
call transaction callbacks after updating the transaction levels (#3…
Browse files Browse the repository at this point in the history
  • Loading branch information
themsaid authored Apr 6, 2021
1 parent 96334c9 commit 103261a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Illuminate/Database/Concerns/ManagesTransactions.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ public function transaction(Closure $callback, $attempts = 1)
}

try {
if ($this->transactions == 1) {
$this->transactions = max(0, $this->transactions - 1);

if ($this->transactions == 0) {
$this->getPdo()->commit();

optional($this->transactionsManager)->commit($this->getName());
}

$this->transactions = max(0, $this->transactions - 1);
} catch (Throwable $e) {
$this->handleCommitTransactionException(
$e, $currentAttempt, $attempts
Expand Down

0 comments on commit 103261a

Please sign in to comment.