[Zope3-dev] zwiki: performance of findChildren()

Steve Alexander steve@cat-box.net
Fri, 25 Apr 2003 19:31:18 +0200


> I would say that the problem is that we can't get the path to traverse 
> to get to an object if we know only its oid.

I would also add that this isn't a problem. :-)

It's a bit like wanting to dereference an object in Python from its 
id(). But more so ;-)  because of the need to maintain context wrappers.


There's a similar situation with the undo feature of Zope 2. ZODB 
transactions in Zope 2 are annotated with the path of the request that 
caused the transaction. When you ask "What may I undo at this location?" 
your question is answered by looking back in time through past 
transactions for those that have a path the same as, or below, the path 
you're interested in.

So, the oid to path mapping is held in the transaction annotations.

One curious effect of this is that if you remove an object from a 
folder, and put a different kind of object in that folder with the same 
name as the object you removed, you'll get the old object's undo log.

--
Steve Alexander