[Zope-dev] Product refresh causes database connections leaking

Shane Hathaway shane@zope.com
Wed, 07 May 2003 15:28:59 -0400


Clemens Robbenhaar wrote:
>  It is a little hard to say what is going on without details how and
> where the connections are created. Anyway I have heard rumours, that the
> "refresh" feature is not considered the most stable thingy in Zope, but
> more a developer convenience hack.
>  If You restart Your development server every forth time You usually
> would do a refresh, You save Yourself a longer debugging session.

That's about right.  The refresh functionality uses features of ZODB and 
Python that haven't been perfected, and the result is occasional 
surprises.  My rule is that if there's no really obvious explanation 
(i.e. about 5 seconds) for a bug that appears after a refresh, I restart 
Zope.

The most common refresh-related bug is "AttributeError: None has no 
attribute <foo>".  It happens because an old class instance or function 
is still alive.  If that happens often, fix up the refresh dependencies 
to ensure that derived products are always refreshed after a base product.

Shane