[Zope] ZODB question: get older object versions without undo
Chris McDonough
chrism@digicool.com
Tue, 10 Oct 2000 08:29:06 -0400
Philipp Auersperg wrote:
> I have two questons concerning ZODB:
>
> 1. Since ZODB does not overwrite objects on change one can get the older
versions when
> undoing the changes.
> My question now: how can I access older versions of objects without
undoing?
> transactions? (I had a short glance at the ZODB classes, but found
nothing)
In Zope 2.2, objects that expose a "history" tab (e.g. DTML Methods) can be
reverted to one of their historical revisions. You may want to look at how
these objects implement this feature if you'd like to create your own
historying objects.
> 2.Is it possible ( or will be ) to define ZODB objects for which updates
are done by
> overwriting and not appending to the object database
Not with FileStorage... it would be possible to do so with a relational
storage or with another kind of storage like BerkeleyStorage.
> - That is an important issue for objects that are subject to frequent and
simple
> changes. For example Webcounters or Advertising banners that count the
clicks. Solutions
> to write these changes into external files (like FSCounter) are not more
than emergency
> solutions for me.
For right now, the only way to get the behavior you want is to use a
nonundoing storage.
In the future, the default Zope storage will probably not be FileStorage.
Instead, it will probably be something more flexible that doesn't require an
all-appends strategy to maintain transactional integrity (or at least one
that abstracts this behavior out). With a (as-yet-mythical) next-generation
storage, there will be a more granular way to indicate that you'd like an
object to overwrite a previous historical revision.