On Aug 20, 2007, at 2:25 AM, Christian Theune wrote:


just for my understanding: we don't get bitten by this because Zope uses
the ThreadTransactionManager which keeps objects within one thread (at
one time)?

Dieter appears to have been bitten by this and he is one of we. :)

We, and I presume he, can be bitten by a Python function called from BTree code calling back into the code on the same object. This is possible, for example, in a __cmp__ or related method. I assume that this is what happened to Dieter. Obviously, this would be a fairly "special" comparison method.

In general though, you are right that the ZODB is designed to support a threading model in which multiple threads run single-threaded code in multiple isolated threads.

It's worth noting that there are indirect ways that objects can be called from multiple threads:

- Object deactivation. Until recently (3.8), objects could be deactivated from other threads while they were in use by n application threads.

- __del__ methods or weakref callbacks can cause calls to persistent objects from other (non-application) threads.


Jim Fulton                      mailto:[EMAIL PROTECTED]                Python 
CTO                             (540) 361-1714                  
Zope Corporation        http://www.zope.com             http://www.zope.org

For more information about ZODB, see the ZODB Wiki:

ZODB-Dev mailing list  -  ZODB-Dev@zope.org

Reply via email to