20 Nov
2006
20 Nov
'06
1:24 p.m.
On 11/20/06, Marco Bizzarri <marco.bizzarri@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