transactionNestingLevel++; } public function rollBack(): void { parent::rollBack(); $this->transactionNestingLevel--; } /** * @throws Exception * @throws \Doctrine\DBAL\Driver\Exception */ public function commit(): void { parent::commit(); $this->transactionNestingLevel--; if ($this->transactionNestingLevel === 0) { $this->backgroundQueue->doPublishToBroker(); } } }