/** * Check if exception an exception was thrown. If so rollback event store transaction * otherwise commit it. * * @param ActionEvent $actionEvent */ public function onFinalize(ActionEvent $actionEvent) { if ($this->eventStore->isInTransaction()) { if ($actionEvent->getParam(CommandBus::EVENT_PARAM_EXCEPTION)) { $this->eventStore->rollback(); } else { $this->eventStore->commit(); } } $this->currentCommand = null; }