On May 23, 2007, at 10:44 AM, Aaron Iles wrote:

>
>
> =Discussion=
> 1. Is this an issue that SQLAlchemy ought to be concerned with. Or is
> this an issue for the utilising applicaiton?
>

SQLAlchemy is concerned with this.

> =Possible Solutions=
> There are at least two possible solutions inside of SQLAlchemy.
>
>
> 2. Put cursor.execute() calls inside a try/except block that looks for
> exception codes 2006, reconnecting to the database and reissueing the
> statement if trapped.

we do half of that (we catch 2006 and reconnect on next usage).  but  
no reissuing of statements (breaks the transactional model), so youll  
get at least one error raised.  this feature however is intended to  
handle a database that was completely shut down and restarted - all  
connections in the pool are expired.  its not intended for a normal  
connection timeout.

For your use case, you need solution 3:

3. use the pool_recycle argument on create_engine().

http://www.sqlalchemy.org/docs/dbengine.html#dbengine_options

also mentioned in the FAQ...


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to