Excellent! This is exactly what I needed.

For reference, I attach your code and I hope it will get referenced by search 
engines :).

Attached History.py is an enhancement of OFS.History that enables read access 
to old revisions of an object, even if that object has persistent subobjects. 
Author: Dieter Maurer

Thanks a lot.

Pascal

-----Message d'origine-----
De : Dieter Maurer [mailto:[EMAIL PROTECTED] 
Envoyé : jeudi 13 avril 2006 21:56
À : Pascal Peregrina
Cc : zodb-dev@zope.org
Objet : RE: [ZODB-Dev] Question about BTree transaction data

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


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************

Attachment: History.py
Description: History.py

_______________________________________________
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