[Zodb-checkins] CVS: ZODB3/ZEO - ClientStorage.py:1.56

Jeremy Hylton jeremy@zope.com
Mon, 9 Sep 2002 14:34:03 -0400


Update of /cvs-repository/ZODB3/ZEO
In directory cvs.zope.org:/tmp/cvs-serv20622

Modified Files:
	ClientStorage.py 
Log Message:
Handle abortVersion() correctly with all versions of ZODB.

Different versions of ZODB do different things with the serialnos for
abortVersion().  To be safe and avoid giving non-version data with an
invalid serialno after an abort version, invalidate the version and
non-version data.

This hurts cache effectiveness when a version is aborted, but I expect
it will have little practical impact.


=== ZODB3/ZEO/ClientStorage.py 1.55 => 1.56 ===
--- ZODB3/ZEO/ClientStorage.py:1.55	Sat Sep  7 20:20:20 2002
+++ ZODB3/ZEO/ClientStorage.py	Mon Sep  9 14:34:03 2002
@@ -243,8 +243,17 @@
     def abortVersion(self, src, transaction):
         self._check_trans(transaction)
         oids = self._server.abortVersion(src, self._serial)
+        # When a version aborts, invalidate the version and
+        # non-version data.  The non-version data should still be
+        # valid, but older versions of ZODB will change the
+        # non-version serialno on an abort version.  With those
+        # versions of ZODB, you'd get a conflict error if you tried to
+        # commit a transaction with the cached data.
+
+        # XXX If we could guarantee that ZODB gave the right answer,
+        # we could just invalidate the version data.
         for oid in oids:
-            self._tbuf.invalidate(oid, src)
+            self._tbuf.invalidate(oid, '')
         return oids
 
     def commitVersion(self, src, dest, transaction):