[Zodb-checkins] CVS: Zope2/lib/python/ZODB - FileStorage.py:1.55
jeremy@digicool.com
jeremy@digicool.com
Wed, 2 May 2001 16:47:38 -0400 (EDT)
Update of /cvs-repository/Zope2/lib/python/ZODB
In directory korak:/tmp/cvs-serv18994
Modified Files:
FileStorage.py
Log Message:
Fix conflict resolution bug in transactionalUndo.
The value of _loadBack() -- a pickle and a serialno -- was being
passed to tryToResolveConflict() where only a pickle was expected.
XXX _loadBack() can raise KeyError, but this wasn't handled by the
code. Turn into UndoError() for now.
--- Updated File FileStorage.py in package Zope2/lib/python/ZODB --
--- FileStorage.py 2001/04/12 23:38:25 1.54
+++ FileStorage.py 2001/05/02 20:47:37 1.55
@@ -937,8 +937,13 @@
# we can just copy our previous-record pointer forward
return '', pre, version, snv, ipos
- data=self.tryToResolveConflict(
- oid, cserial, serial, _loadBack(self._file, oid, p64(pre)), cdata)
+ try:
+ # returns data, serial tuple
+ bdata = _loadBack(self._file, oid, p64(pre))[0]
+ except KeyError:
+ # couldn't find oid; what's the real explanation for this?
+ raise UndoError("_loadBack() failed for %s" % repr(oid))
+ data=self.tryToResolveConflict(oid, cserial, serial, bdata, cdata)
if data:
return data, 0, version, snv, ipos