public function executeComment_post() { $message = mfwRequest::param('message'); $package_id = mfwRequest::param('package_id'); $con = mfwDBConnection::getPDO(); $con->beginTransaction(); try { $this->app = ApplicationDb::retrieveByPkForUpdate($this->app->getId()); $comment = CommentDb::post($this->login_user, $this->app, $package_id, $message); $this->app->updateLastCommented($comment->getCreated()); $con->commit(); } catch (Exception $e) { error_log(__METHOD__ . '(' . __LINE__ . '): ' . get_class($e) . ":{$e->getMessage()}"); $con->rollback(); throw $e; } $owners = $this->app->getOwners(); $owners->noticeNewComment($comment, $this->app); return $this->redirect('/app/comment', array('id' => $this->app->getId())); }