[ZODB-Dev] Undo differences between Z2 and Z3
Jim Fulton
jim at zope.com
Tue May 16 13:18:24 EDT 2006
David Pratt wrote:
> There seems to be enough of a difference between Z2 and Z3 undo to have
> an effect on a backend like PGStorage from working on Z3. I believe the
> objective in the storage api is that it should not matter to the backend
> whether you are connected to Z2 or Z3. Can someone more familiar with
> the history of undo in z2 and z3 explain the current situation?
Undo has a fairly complicated API, and I can easily believe that Z2 and
Z3 call that API in very different ways.
BTW, I strongly discourage use of Undo except in emergencies.
Sadly, except when undoing the last (non-undo) transactions in
a database can lead to inconsistency. Undo should be used with
caution and should generally not be exposed to non-expert users.
> In Z3, before bringing up the contents view, there is a check of the
> undo transactions for the principal. It uses z3's undo manager to
> getPrincipalTransactions which eventually results in a lookup in the
> undoLog in the external storage where it dies. Just a brief look at the
> undo code in z3 gives me the feeling the format
Format of what?
> between z2 and z3 may be
> incompatible which may be the problem.
>
> The relevant portion of the traceback I receive is this:
>
> File "/usr/local/zope3/z3trunk/src/zope/tales/expressions.py", line
> 199, in _eval
> return ob()
> File
> "/usr/local/zope3/z3trunk/src/zope/app/publisher/browser/viewmeta.py",
> line 419, in __call__
> return meth(*a, **k)
> File "/usr/local/zope3/z3trunk/src/zope/app/undo/browser.py", line 33,
> in principalLastTransactionIsUndo
> last=1)
> File "/usr/local/zope3/z3trunk/src/zope/app/undo/__init__.py", line
> 108, in getPrincipalTransactions
> return self._getUndoInfo(context, principal, first, last)
> File "/usr/local/zope3/z3trunk/src/zope/app/undo/__init__.py", line
> 129, in _getUndoInfo
> entries = self.__db.undoInfo(first, last, specification)
> File "/usr/local/zope3/z3trunk/src/ZODB/UndoLogCompatible.py", line
> 37, in undoInfo
> return self.undoLog(first, last, filter)
> File "/usr/local/zope3/z3trunk/src/ZODB/PGStorage/pgstorage.py", line
> 478, in undoLog
> d.update(cPickle.loads(ext))
You should report this to Shane.
It's possible that there is a bug in PGStorage in handling
extension data. I can easily believe that Z2 doesn't use extension
data and perhaps z3 does.
Jim
--
Jim Fulton mailto:jim at zope.com Python Powered!
CTO (540) 361-1714 http://www.python.org
Zope Corporation http://www.zope.com http://www.zope.org
More information about the ZODB-Dev
mailing list