On May 12, 2008, at 7:02 AM, nymaol wrote:

>
> Hi, I am using SQLALchemy 0.4.5 and PostgreSQL 8.1 db with psycopg2.
> If I restart the db I need to also restart my python server that is
> using the SQLAlchemy for interfacing the PostgreSQL db. Is there any
> means in the SQLAlchemy to automatically reconnect to the db without
> needing to restart the server? I do not mean pool_recyle-attribute,
> because that does not do the reconnection when needed but just in
> specified intervals.

the Connection will hit a "connection closed" error when first used;  
when that's detected, the entire connection pool is recycled.  so the  
error should happen exactly once and then resolve itself after that.

psycopg2 has been known to have a lot of quirks in this area, such as  
not throwing the exception in a way that it can be caught in all  
cases, so feel free to document situations where this does not work as  
expected.  (use recent versions of psycopg2/sqla for best results too).





--~--~---------~--~----~------------~-------~--~----~
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