Skip to content

Commit

Permalink
fix: explicitly stage/clear transaction to correctly run afterCommit …
Browse files Browse the repository at this point in the history
…jobs

[laravel v10.32.0](laravel/framework#48859) requires explicit staging of transactions
  • Loading branch information
oprudkyi committed Nov 17, 2023
1 parent b57fa3d commit 3bc31f4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ Changed
- [Breaking] SessionNotFoundErrorMode was removed and will always run clear session pool. (#132) (#130)
- [Breaking] Auth cache and Session pool now share the same file cache adapter (#139)

Fixed
- Explicitly stage/clear transaction on commit to correctly run afterCommit jobs in Laravel >= [v10.32.0](https://github.com/laravel/framework/pull/48859) (#144)

# v5.2.2 (2023-08-22)

Fixed
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"php": "^8.1",
"ext-grpc": "*",
"ext-json": "*",
"laravel/framework": "~10.0",
"laravel/framework": "^10.32.0",
"google/cloud-spanner": "^1.58.4",
"grpc/grpc": "^1.42",
"symfony/cache": "~6",
Expand Down
2 changes: 2 additions & 0 deletions src/Concerns/ManagesTransactions.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ protected function performSpannerCommit(): void
$this->currentTransaction->commit();
}

$this->transactionsManager?->stageTransactions($this->getName());

$this->transactions = max(0, $this->transactions - 1);
if ($this->isTransactionFinished()) {
$this->currentTransaction = null;
Expand Down

0 comments on commit 3bc31f4

Please sign in to comment.