Skip to content

Commit

Permalink
Revert release/rollback to be before future resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
trowski committed Dec 2, 2023
1 parent 6850044 commit 1d0fa1e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/NestedTransaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,22 +177,22 @@ public function commit(): void
$this->awaitPendingNestedTransaction();
$this->active = false;

$this->executor->releaseSavepoint($this->identifier);

$onRollback = $this->onRollback;
$this->transaction->onRollback(static fn () => $onRollback->isComplete() || $onRollback->complete());
$this->onClose->complete();

$this->executor->releaseSavepoint($this->identifier);
}

public function rollback(): void
{
$this->awaitPendingNestedTransaction();
$this->active = false;

$this->executor->rollbackTo($this->identifier);

$this->onRollback->complete();
$this->onClose->complete();

$this->executor->rollbackTo($this->identifier);
}

public function onCommit(\Closure $onCommit): void
Expand Down

0 comments on commit 1d0fa1e

Please sign in to comment.