diff --git a/src/DoctrineDbalContentGraphProjection.php b/src/DoctrineDbalContentGraphProjection.php index 1c1b1dc..27be786 100644 --- a/src/DoctrineDbalContentGraphProjection.php +++ b/src/DoctrineDbalContentGraphProjection.php @@ -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(); } }