private function rollback(int &$flushCounter): void
    {
        if (null === $this->rollback) {
            return;
        }

        ($this->rollback)();
        $this->eventDispatcher->dispatch(new RollbackEvent($this, $flushCounter));
        $flushCounter = 0;
    }