[sqlalchemy] Re: Testing for validity of a Connection

2007-08-31 Thread Mike Orr
On 8/31/07, Michael Bayer [EMAIL PROTECTED] wrote: however in most cases keeping a low pool_recycle should take care of most common issues in this area... What it doesn't handle is if the database server is restarted. That doesn't happen very often with reliable database servers nowadays but

[sqlalchemy] Re: Testing for validity of a Connection

2007-08-31 Thread Paul Johnston
Hi, What it doesn't handle is if the database server is restarted. That doesn't happen very often with reliable database servers nowadays but it is possible. Yes, this is something of a problem for long-running apps that used pooled database connections. I did some work with Mike a few

[sqlalchemy] Re: Testing for validity of a Connection

2007-08-30 Thread Moshe C.
I was hoping there was something more elegant than just trying and catching a possible exception. The motivation is just simpler and more readable code like if not connection.is_valid(): get another one On Aug 30, 5:25 pm, Paul Johnston [EMAIL PROTECTED] wrote: How about,

[sqlalchemy] Re: Testing for validity of a Connection

2007-08-30 Thread Mike Orr
On 8/30/07, Moshe C. [EMAIL PROTECTED] wrote: I was hoping there was something more elegant than just trying and catching a possible exception. The motivation is just simpler and more readable code like if not connection.is_valid(): get another one The issue is that in a packet-based