public function tryLockJob(Entity\Cronjob $job)
    {
        $em = $this->getEm();
        $repo = $em->getRepository('AdfabCore\Entity\Cronjob');
        if ($job->getStatus() === Mapper\Cronjob::STATUS_PENDING) {
            $job->setStatus(Mapper\Cronjob::STATUS_RUNNING);
            $em->persist($job);
            $em->flush();

            // flush() succeeded if reached here;
            // otherwise an Exception would have been thrown
            return true;
        }

        return false;
    }