[ZODB-Dev] ZODB _v_ attributes are tricky
Shane Hathaway
shane at zope.com
Fri Apr 2 11:48:42 EST 2004
Tim Peters wrote:
> [Toby Dickenson]
>
>>The garbage collector can also be triggered explicitly by application
>>code, and future improvements to the garbage collector might unload
>>objects at other times too. In short, you should assume that _v_
>>variables might disappear at any time.
... or never, which equally confuses people.
> Part of the problem I perceive (and correct me if I'm wrong) is that the
> docs are so lacking now that very few people are able to distinguish
> accidental behavior from "officially supported" behavior. I know for a fact
> that Jeremy & I run into that repeatedly when trying to fix, or improve, or
> even just clean up, internals. We have large, interrelated, APIs, and
> endcase behavior is often plain mysterious.
IMHO, _v_ attributes ought to be internal to ZODB. Instead, ZODB ought
to provide two kinds of documented descriptors: Volatile and
TransactionalVolatile. Volatile attributes revert to the default state
at any time; TransactionalVolatile attributes reliably revert to the
default state upon commit or rollback (including savepoint commit or
rollback).
Shane
More information about the ZODB-Dev
mailing list