-
Notifications
You must be signed in to change notification settings - Fork 11.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exception thrown in DB::afterCommit cause "Syntax error or access violation: 1305 SAVEPOINT trans2 does not exist" error #36886
Labels
Comments
Possible fix try {
$this->transactions = max(0, $this->transactions - 1);
if ($this->transactions == 0) {
$this->getPdo()->commit();
optional($this->transactionsManager)->commit($this->getName());
}
} catch (Throwable $e) {
$this->handleCommitTransactionException(
$e, $currentAttempt, $attempts
);
continue;
} |
@themsaid any thoughts on this one? |
It seems we have one more issue around this
in success case we have infinity loop. Laravel version: 8.40.0 |
@themsaid any news on this ? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description:
DB::afterCommit
callbacks are executed before transaction level get decremented. So in case if callback do some actions inside it's own transaction and throws exception we will getSyntax error or access violation: 1305 SAVEPOINT trans2 does not exist
DB error (percona in my case)Steps To Reproduce:
The text was updated successfully, but these errors were encountered: