On Thu, 2004-04-01 at 00:25, Ian Beatty wrote:
> I thought "Okay, no problem. I'll just make the lock variable volatile,
> since I don't really care whether it persists when Zope shuts down." So I
> renamed the lock to begin with '_v_'. That solves my "UnpickleableError"
> problem nicely. Unfortunately, it introduces a different problem: the code
> that calls acquire() on the lock now throws "AttributeError: 'NoneType'
> object has no attribute 'acquire'". I'm sure I initialize that variable to a
> threading.Lock() in the object's __init__ method. So now I'm worried that
> Zope is doing all kinds of pickling-unpickling activity behind the scenes,
> and anything I have that's volatile can disappear without warning.

I'm not sure about this right now, but iirc _v_ attributes are not
stored until "zope shutdown" but until the object is reloaded from the
ZODB (for whatever reason it went out of the cache). This basically
means no availability longer than until the end of one request can be


Christian Theune, gocept gmbh & co. kg
http://www.gocept.com - [EMAIL PROTECTED]
fon: 03496 3099112 fax: 03496 3099118 mobile: 0179 7808366

Attachment: signature.asc
Description: This is a digitally signed message part

Zope-Dev maillist  -  [EMAIL PROTECTED]
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope )

Reply via email to