7 messages in com.googlegroups.sqlalchemy[sqlalchemy] Re: sqlalchemy.exception...
FromSent OnAttachments
Jian Luo29 Aug 2007 08:57 
jason kirtland29 Aug 2007 13:05 
Jian Luo29 Aug 2007 14:57 
jason kirtland29 Aug 2007 15:10 
Jian Luo29 Aug 2007 15:37 
jason kirtland29 Aug 2007 15:49 
Michael Bayer29 Aug 2007 17:23 
Subject:[sqlalchemy] Re: sqlalchemy.exceptions.TimeoutError with psycopg2
From:jason kirtland (je@discorporate.us)
Date:08/29/2007 03:10:21 PM
List:com.googlegroups.sqlalchemy

Jian wrote:

Hi Jason,

thanks for the reply.

My pylons basecontroller takes care of the session clean up like this:

class BaseController(WSGIController): def __call__(self, environ, start_response): try: return WSGIController.__call__(self, environ, start_response) finally: model.Session.remove()

When I use model.Session.close(), everything works. But error comes whenever i change it to model.Session.remove(). AFAIK, remove() make more sense than close() on a real site with dynamic load which is learned from SA docs.

I believe that remove() simply detaches the session from the current context, it doesn't explicitly close it out or release the bound connection for a transactional session. Try closing before you remove.