public function commit()
    {
        // Ignore if no transaction
        if ($this->transactionDepth === 0) {
            return;
        }

        --$this->transactionDepth;
        if ($this->transactionDepth === 0) {
            foreach ($this->signalsQueue as $signalsQueue) {
                foreach ($signalsQueue as $signal) {
                    $this->signalDispatcher->emit($signal);
                }
            }

            // To avoid possible int overflow on long running processes
            $this->transactionCount = 0;
            $this->signalsQueue = array();
        }
    }