[Zope] Persistent object in volatile dictionary on a per thread basis

Martijn Pieters mj at zopatista.com
Mon Nov 20 08:24:02 EST 2006


On 11/20/06, Marco Bizzarri <marco.bizzarri at gmail.com> wrote:
> I would like to know if it can be considered safe to keep an object in
> a volatile (i.e. non persistent) dictionary, one for each thread.

Yes, it is perfectly legal. All attributes starting with _v are
considered volatile and won't be persisted, including dictionaries
stored as such attributes.

> Is it possible to have the dreaded error, i.e.
>
> exceptions.RuntimeError
> Shouldn't load state for 0x01254260 when the connection is closed

That error would not be connected to _v volatile attributes, as they
are skipped when storing and are therefor not present when loading.
The error has to do with a closed ZODB database connection instead,
for whatever reason.


-- 
Martijn Pieters


More information about the Zope mailing list