[ZODB-Dev] Question about BTree transaction data
Dieter Maurer
dieter at handshake.de
Wed Apr 12 13:40:47 EDT 2006
Pascal Peregrina wrote at 2006-4-12 08:35 +0100:
>I use FileStorage (via ZEO).
>
>I have switched a big dictionary from PersistentMapping to BTree.
>
>In the past, it was easy to compute added/deleted keys from states (cause PersistentMapping state contains the whole dictionary, so it was only a matter of getting the keys and comparing them with previous state keys).
What do you mean by "state"?
What you get with "obj.__getstate__()"?
In this case, you can indeed not compute added/deleted keys
alone from the current and a previous state of the tree alone.
You must also take into account the state of children...
>...
So could you give me a little more details about what you mean? (or of course point me to some example/resources on the net)
Search the mailing list archive (for "zope at zope.org" or
"zope-dev at zope.org") for a post from me about "HistoryJar".
This is a speciallized ZODB connection that loads the state of objects
as it was at a given time.
In this, I do not mean "state" technically as the result of "__getstate__"
but as the complete object state. You can use such a "historical"
object in the same way as you use a "current" object (apart from
not being able to modify it). Especially, you can ask a historical
BTrees.XXBTree instance for
all its keys and compare this to all the keys of the current object.
--
Dieter
More information about the ZODB-Dev
mailing list