public function release(RevisionInterface $revision, UserInterface $user, $comment)
    {
        $connection = $this->revisionRepository->getDbAdapter()->getDriver()->getConnection()->beginTransaction();
        try {
            if ($revision->getReleasedAt() != null) {
                $this->revisionRepository->remove($revision->getEnvironment()->getCurrentRevision());
                $revision = clone $revision;
                $revision->setReleasedAt($this->dateTimeFactory->now());
                $revision->setReleasedBy($user->getName());
                $revision->setComment($comment);
                $this->revisionRepository->add($revision);
            } else {
                $revision->setReleasedAt($this->dateTimeFactory->now());
                $revision->setReleasedBy($user->getName());
                $revision->setComment($comment);
                $this->revisionRepository->update($revision);
            }
            $newCurrentRevision = clone $revision;
            $this->revisionRepository->add($newCurrentRevision);
        } catch (ExceptionInterface $e) {
            $connection->rollback();
            throw $e;
        }
        $connection->commit();
        return $this;
    }