[ZODB-Dev] Disappearing volatile attributes in ZODB 3.6

Dieter Maurer dieter at handshake.de
Fri Jan 12 13:31:48 EST 2007


Terry Jones wrote at 2007-1-12 12:53 +0100:
> ...
>Briefly, I have a class that puts a volatile _v_xxx attribute on instances
>via a method called from its __init__ method. I make 4 instances of this
>class, and immediately assert(hasattr(instance, '_v_xxx')) on return. All
>these assertions succeed.
>
>A little later in my program though, another set of asserts shows that two
>of the four volatile attributes are gone.

The volatile attributes of an object disappear as soon as the the object
is flushed from the ZODB cache.

In principle, this can happen at any time.

However, the current ZODB implementation is quite conservative in
this respect. It flushes objects only at transaction or savepoint
boundaries and when explicitly told by the application.



-- 
Dieter


More information about the ZODB-Dev mailing list