Skip to content

Commit

Permalink
TASK: Use setRollbackOnly to ensure nothing is commited during the …
Browse files Browse the repository at this point in the history
  • Loading branch information
mhsdesign committed Oct 28, 2024
1 parent f27f786 commit 390b067
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Domain/Projection/HypergraphProjection.php
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,11 @@ public function inSimulation(\Closure $fn): mixed
throw new \RuntimeException(sprintf('Invoking %s is not allowed to be invoked recursively. Current transaction nesting %d.', __FUNCTION__, $this->dbal->getTransactionNestingLevel()));
}
$this->dbal->beginTransaction();
$this->dbal->setRollbackOnly();
try {
return $fn();
} finally {
// unsets rollback only flag and allows the connection to work regular again
$this->dbal->rollBack();
}
}
Expand Down

0 comments on commit 390b067

Please sign in to comment.