title: Proper way to use Peewee ORM Pooled Connection
body: <p>I'm using the Peewee ORM in my Python WSGI web app. I've been having issues with the MySQL Server "going away", so I switched to the PooledMySQLDatabase. I will still having issues with the server going away after a few hours..</p>
  
  <p>According to the Docs, for best performance I must manage the connection(s) myself, by calling .connect() and .close(). I was not doing this at all.</p>
  
  <p>I've added 2 decorators that get called before and after every request, but is this correct?</p>
  
  <pre><code>@pre_save()
  def pre_save_handler(sender,instance,created):
      db.connect()
      logger.debug('Attempting to save %s' % instance)
  
  @post_save()
  def post_save_handler(sender, instance, created):
      db.close()
      logger.debug('%s was just saved' % instance)
  </code></pre>
  
  <p>Are there any pitfalls doing it this way? Should I move the .connect() and .close() into my application?</p>