On Mar 23, 2011, at 1:25 PM, Jaimy Azle wrote:

> On Wednesday, March 23, 2011, 10:50:46 AM, Michael Bayer wrote:
> 
>> uh yeah you totally nailed that one, QueuePool and
>> SingletonThreadPool had similar issues.
> 
> it was quite hard to get into this. :)
> 
>> you can get at these from hg via:
> 
>> http://hg.sqlalchemy.org/sqlalchemy/archive/default.tar.gz
>> http://hg.sqlalchemy.org/sqlalchemy/archive/rel_0_6.tar.gz
> 
> Thank you, I'll look into those links. However, I still have another
> issue on those idle connection objects held in the pool. If there is
> no activity related to the database, those connection would be kept
> on idle state in the pool, until then it is checked out and
> refreshed/recycled. I think i would need to extend QueuePool, and
> Queue by adding a functionality to monitor those idle time connection
> and dispose it from the pool when maximum idle time reached.

the pool_timeout parameter manages this from a client perspective, in that a 
stale connection won't be used.   An application with a decent amount of 
activity should clean these connections out regularly as they are closed the 
moment they are called up from the pool, and have passed their expiration time 
(if you aren't observing that, that's another bug).

If you're designing for the use case that the application is doing absolutely 
nothing for hours, then yes the stale connections will just sit there...but I 
would think that an app with such little usage would only have a few 
connections checked out anyway and these are of no consequence.    If you 
really want to sever the TCP link proactively expecting a totally idle 
application, I'd look into getting the database server to perform this severing 
(such as what MySQL does automatically after 8 hours).




> 
> --
> Salam,
> 
> -Jaimy Azle - http://jaim.log.web.id
> 
> 
> 
> -- 
> 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 
> sqlalchemy+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/sqlalchemy?hl=en.
> 

-- 
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 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to