theres a new feature, which i had documented was turned on by default  
but now that im looking it seems it is not; the pool_recycle setting  
which recycles connections after a given amount of time (docs say it  
defaults to 3600 but it appears to be -1, which means none).  the  
impetus for this was to reopen every X seconds/hours to get around  
db's like mysql which close idle connections automatically after 8  
hours.

so, arent you using postgres ?  does postgres have a "close  
connection after X hours of inactivity" type of setting ?  if so, you  
might want to try setting pool_recycle (which is in seconds) to some  
non- -1 value, like 3600 seconds.

if thats the case though, im not sure why you wouldnt have had this  
problem in earlier versions.  also, i cant see what would be closing  
the connection on the pool side of things assuming that recycle  
setting is set to -1.  you can try setting "echo_pool=True" to see  
what shows up in the logs overnight.

On Sep 8, 2006, at 8:25 AM, dmiller wrote:

> Some time in the past I could leave my app running overnight and come
> back in the morning and everything worked fine. More recently that
> stopped working (around SVN r1840 maybe?). Now I get a "connection
> not open" error. Here's the trace:
>
> ...
>    File ".../sqlalchemy/attributes.py", line 32, in __get__
>      return self.get(obj)
>    File ".../sqlalchemy/attributes.py", line 175, in get
>      value = callable_()
>    File ".../sqlalchemy/orm/properties.py", line 417, in lazyload
>      return self.mapper.using(session).get(ident)
>    File ".../sqlalchemy/orm/query.py", line 44, in get
>      return self._get(key, ident, **kwargs)
>    File ".../sqlalchemy/orm/query.py", line 297, in _get
>      return self._select_statement(statement, params=params,
> populate_existing=reload)[0]
>    File ".../sqlalchemy/orm/query.py", line 305, in _select_statement
>      return self.instances(statement, params=params, **kwargs)
>    File ".../sqlalchemy/orm/query.py", line 267, in instances
>      result = self.session.execute(self.mapper, clauseelement,
> params=params)
>    File ".../sqlalchemy/orm/session.py", line 114, in execute
>      return self.connection(mapper, close_with_result=True).execute
> (clause, params, **kwargs)
>    File ".../sqlalchemy/engine/base.py", line 246, in execute
>      return Connection.executors[type(object).__mro__[-2]](self,
> object, *multiparams, **params)
>    File ".../sqlalchemy/engine/base.py", line 270, in
> execute_clauseelement
>      return self.execute_compiled(elem.compile(engine=self.__engine,
> parameters=param), *multiparams, **params)
>    File ".../sqlalchemy/engine/base.py", line 288, in execute_compiled
>      return ResultProxy(self.__engine, self, cursor, context,
> typemap=compiled.typemap)
> OperationalError: connection not open
>
> I noticed that some work has been done on the connection pool
> recently, so maybe that has something to do with it. Let me know if I
> can help to find the problem.
>
> ~ Daniel
>
> ---------------------------------------------------------------------- 
> ---
> Using Tomcat but need to do more? Need to support web services,  
> security?
> Get stuff done quickly with pre-integrated technology to make your  
> job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache  
> Geronimo
> http://sel.as-us.falkag.net/sel? 
> cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Sqlalchemy-users mailing list
> Sqlalchemy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Sqlalchemy-users mailing list
Sqlalchemy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users

Reply via email to