Created a new parameter 'reconnect' to indicate if MySQLAdapter can try ...
I am going to pass on this, but if you would like you can always subclass `MySQLDatabase` and implement this logic yourself. Catching `Exception` is far too broad and I believe this will lead to unpredictable behavior.
 It's true. I created a MySQLWithReconnectDatabase and narrowed the exception to _mysql_exceptions.OperationalError error code 2006.

Thanks, Charles.
 I actually like the idea of having it auto-reconnect on that error, I've
had the same issue before and fixed it by manually making a new connection
every time.

On Wed, May 28, 2014 at 10:56 PM, André Martins notifications@github.comwrote:

> It's true. I created a MySQLWithReconnectDatabase and narrowed the
> exception to _mysql_exceptions.OperationalError error code 2006.
> 
> Thanks, Charles.
> 
> —
> Reply to this email directly or view it on GitHubhttps://github.com/coleifer/peewee/pull/363#issuecomment-44438590
> .
 Perhaps this database subclass could go in `playhouse.mysql_ext`?
 I think there is no need for auto-reconnect feature. 

The connection must be explicitly handled on every request by the developer of the app, not by peewee. That includes opening/closing it when needed.
 > The connection must be explicitly handled on every request by the developer of the app, not by peewee. That includes opening/closing it when needed.

**Yes.**
 I agree, but there is not a single point in code to handle this. Instead, every use of peewee can throw this error. How could separate responsabilities and use peewee with a datapool, for example?
 In case you're interested, I've got a mixin for retrying failed queries in 017e4e4952f0b429dd21f0e90465a0f644cf6015 . Docs:

http://docs.peewee-orm.com/en/latest/peewee/database.html#automatic-reconnect

Created a new parameter 'reconnect' to indicate if MySQLAdapter can try reconnect to server. 
In long time connections, timeout makes connection to drop.
I have an app that faces too many "MySQL server has gone away" errors. So, this can try reconnect to the server in case of timeout.
