[Zope-dev] Question about _v_ attributes and database connections

Dieter Maurer dieter at handshake.de
Fri Mar 5 16:57:20 EST 2004


Marco Bizzarri wrote at 2004-3-5 09:18 +0100:
>We're trying to tackle a problem in hanging connections in ZPsycopg.
>However, I would like to have some information about the functioning of
>the _v_ attributes, and the cache management. In particular:
>
>1) where is the code which handles the _v_ attributes (I like to look at
>the source code, you know ;))

in "ZODB/cPersistence.c".

>2) where is the code which handles the caching of the objects?

in "ZODB/cPickleCache.c"

>3) is it possible to disable caching of some object?

No, but you can (in most cases) flush it again
by calling its "_p_deactivate" method.

You can always do it by assigning "None" to "_p_changed", but this
is highly unsafe. You should not do it (unless you really know
what you are doing).

>4) when an _v_ attribute is removed, what code of the object/attribute
>itself is called?

The object's "__del__" method (if defined).
This means the object that was bound to the "_v_" attribute
not the object that had the "_v_attribute".

-- 
Dieter



More information about the Zope-Dev mailing list