[Zope] Pointer-to-Object Properties, ObjectManagers and Z2 Conflicts

gtk gtk@well.com
Wed, 3 Nov 1999 10:22:57 +1100


[Jim -- some detail on tangled objectmanagers?]

> A small step up from this is to replace the second list (a list
> of authors in a Book object) with a Catalog. The Book can determine all
> of it's authors by searching the index of 'book-list' properties.
>
> With this change you never break data integrity by changing the list,
> although it is possible to break it by deleting a Book.

All you need to do is arrange for self.unindex_object to be called by
self.manage_beforeDelete, I think.

Oh, wierd! I just figured out why it's so hard to untangle the relationship
between ObjectManagers and their children. The children are stored as
attributes of the ObjectManager itself, NOT in a dict. This makes some sense
from an acquisition point of view, but probably means that there are a whole
bunch of "reserved ids" like manage_beforeDelete.

    Error Type: Bad Request
    Error Value: The id manage_beforeDelete is invalid - it is already in
use.

Yup!

Can anyone tell me why Zope doesn't use __getattr__ to handle access to
children of ObjectManagers and store the mapping to those children in a
dictionary? That way we might have half a chance of preventing ZODB
conflicts when adding multiple children simultaneously without losing the
protection of ZODB conflicts when overlapping transactions try to modify the
same attribute.

Regards,
Garth.

--
<gtk@well.com>