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 52285ec commit d584065
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/DoctrineDbalContentGraphProjection.php
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,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 d584065

Please sign in to comment.