[sqlalchemy] Re: Connection handling, re-establishing connections?
On 3/25/07, Michael Bayer [EMAIL PROTECTED] wrote: Still, all of these measures require that we actually get an error thrown to detect that a restart took place, which inconveniently usually happens not at the point of cursor() but at the point of execute(), and we dont have any frameworks in place (nor am i terribly comfortable with) to handle error was thrown, reconnect and try execute() again. lots of things can go wrong with that, namely transactional state getting lost, mis-interpreted errors resulting in double-executions, race conditions, etc. so i dont know if theres a way to recover from DB restarts 100% seamlessly. I agree, trying to make it seamless is a waste of time. I'd just like to see it be able to re-connect and work again on new queries, eventually. I'll have a look at the ticket but the Fairies intimidate me. :) -Jonathan --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[sqlalchemy] Re: Connection handling, re-establishing connections?
automatically, no. manually, call engine.dispose() or connection.invalidate(). we have some support for automatic connection invalidation in mysql. in postgres we have made some attempts but havent really narrowed down where the errors get thrown and how to distinguish them from regular SQL errorsgenerally its extremely tedious to test since you have to keep stopping/starting postgres, etc., FTR, ive never seen any connection pools in any language (Java, etc. ) that can gracefully handle reconnections...they all require restarting of some kind. On Mar 25, 2007, at 2:15 PM, Andreas Jung wrote: How does SA deal internally with connection errors or when connections go away. In my particular case Zope creates a new session for every incoming HTTP request. What will happen if the corresponding server process dies (e.g. the postmaster of Postgres crashes)? Is SA able to re-establish a connection when needed? Andreas --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[sqlalchemy] Re: Connection handling, re-establishing connections?
I should mention that for normal idle connection timeouts, we have an argument recycle which will set a time limit on the lifespan of each connection held in the pool, so that all connections are guaranteed to be of a certain freshness. On Mar 25, 2007, at 2:15 PM, Andreas Jung wrote: How does SA deal internally with connection errors or when connections go away. In my particular case Zope creates a new session for every incoming HTTP request. What will happen if the corresponding server process dies (e.g. the postmaster of Postgres crashes)? Is SA able to re-establish a connection when needed? Andreas --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---