title: Doctrine2 connection timeout in daemon
body: <p>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.</p>
  
  <p>I noticed that when that there is a tendency for the worker to die because the connection to MySQL timed out when worker is idling waiting for work. </p>
  
  <p>Specifically, I see this in the log: MySQL Server has gone away.</p>
  
  <p>Is there anyway I can have doctrine automatically reconnect? Or is there some way I can manually catch the exception and reconnect the doctrine orm?</p>
  
  <p>Thanks</p>