On Dec 13, 2006, at 4:32 AM, Mike Orr wrote: > I'm not sure how to return a connection to the pool if the application > just lets it go out of scope rather than returning it. Would it be unacceptable just to say that applications are not allowed to do that. Maybe the pattern should be to use some kind of "with" block, or a obtain-release-connection decorator for all request handling methods. > I'll have to > see how SQLAlchemy does it. That sounds like a good place to look. > Would a weak reference help? I think you could do that, but there are always other bad things that the application could do that would keep connections from being returned to the pool.