On Mon, 13 Mar 2006 19:54:43 +0100, Dieter Maurer wrote:

>>To make a long story short, the current implementation of
>>historicalRevision in Zope's OFS/History.py calls oldstate() in
>>ZODB/Connection.py.  The serializer then calls getState() in
>>ZODB/serialize.py (class ObjectReader), which sets up an unpickler to
>>handle persistent references by overriding _persistent_load(). 
>>Unfortunately, when the _persistent_load subroutine comes across a
>>persistent reference, it either loads the CURRENT referenced object
>>from the ZODB (using the oid and ZODB/Connection.py's get()), or loads the
>>CURRENT referenced object from cache.  It does not take 'tid' into account
>>when it loads persistent references.
> A long time ago, I posted code (I think to "zope-dev@zope.org")
> that does it for you in the right way.
> It defines a "HistoricalConnection" which retrieves objects
> with a state as of a given time.
> You might search for "historicalRevision" and "HistoryJar"
> to locate the post.
> Zope 2.8/ZODB 3.4 broke my implementation but it would probably
> not too difficult to get fixed.

Dieter --

I found your code a while back and actually looked it over quit a bit
before I started coding the solution I attached.  Would you be able to
explain how it works?  A lot of your code made sense, but I was a bit
overwhelmed by some of it.

Here's the link:

BTW, if your posted solution is still viable, I'd be more than happy to
help port it to 2.8, or help out in whatever other capacity I can.

For more information about ZODB, see the ZODB Wiki:

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

Reply via email to