[ZODB-Dev] Question about BTree transaction data

Pascal Peregrina Pperegrina at Lastminute.com
Fri Apr 14 04:02:47 EDT 2006


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:dieter at handshake.de] 
Envoyé : jeudi 13 avril 2006 21:56
À : Pascal Peregrina
Cc : zodb-dev at 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
**********************************************************************

-------------- next part --------------
A non-text attachment was scrubbed...
Name: History.py
Type: application/octet-stream
Size: 9211 bytes
Desc: History.py
Url : http://mail.zope.org/pipermail/zodb-dev/attachments/20060414/05fb410b/History-0001.obj


More information about the ZODB-Dev mailing list