Pascal Peregrina wrote at 2006-4-13 11:26 +0100:
>So, if I use HistoryJar to load a BTree from a given old state, are you sure 
>HistoryJar will correctly load all the BTree subobjects (sub BTrees and 
>Buckets)? I got the impression, reading HistoryJar code, that it might load 
>current state of subobjects, not old states... :(

The "HistoryJar" I spoke of is an improvement over
the one you find in "OFS.History".

My "HistoryJar" binds persistent subobjects to itself. This way,
not only the main object is loaded with the state at a given
time but all its subobjects (and subsubobjects, etc.) as well.
It works not only for atomic objects (those without persistent subobjects)
but with arbitrary object hierarchies.

All you need for this to work is to ensure that persistent subobjects
are not associated with the original (the current time) connection
but remain associated with the "HistoryJar".


I posted my "HistoryJar" implementation. Please, search the archives...

It will require modifications to work for ZODB 3.4 or higher,
as connection handling drastically changed between ZODB 3.2
and ZODB 3.4 -- but it will not be difficult to extends for
these ZODB versions (once you know, that the essential thing
is to preserve the connection for persistent subobjects)...


-- 
Dieter
_______________________________________________
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zodb-dev

Reply via email to