I have a long running daemon (Symfony2 Command) that gets work off a work queue in Redis, and performs those jobs and writes to the database using the orm.
I noticed
I'm using this in my symfony2 beanstalkd daemon Command worker:
$em = $this->getContainer()->get('doctrine')->getManager(); if ($em->getConnection()->ping() === false) { $em->getConnection()->close(); $em->getConnection()->connect(); }