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

Jeremy Hylton jeremy at zope.com
Tue May 13 13:34:18 EDT 2003


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

Modified Files:
      Tag: ZODB3-3_1-branch
	ClientStorage.py 
Log Message:
Finish backport of atomic invalidations code.


=== ZODB3/ZEO/ClientStorage.py 1.73.2.13 => 1.73.2.14 ===
--- ZODB3/ZEO/ClientStorage.py:1.73.2.13	Tue Apr 29 17:39:56 2003
+++ ZODB3/ZEO/ClientStorage.py	Tue May 13 12:34:18 2003
@@ -884,10 +884,16 @@
         # Invalidations are sent by the ZEO server as a sequence of
         # oid, version pairs.  The DB's invalidate() method expects a
         # dictionary of oids.
-
+        
+        # versions maps version names to dictionary of invalidations
+        versions = {}
         for oid, version in invs:
+            d = versions.setdefault(version, {})
             self._cache.invalidate(oid, version=version)
-            self._db.invalidate(oid, version=version)
+            d[oid] = 1
+        if self._db is not None:
+            for v, d in versions.items():
+                self._db.invalidate(d, version=v)
 
     def endVerify(self):
         """Server callback to signal end of cache validation."""
@@ -909,19 +915,14 @@
         log2(INFO, "endVerify finished")
 
     def invalidateTrans(self, args):
-        """Server callback to invalidate a list of (oid, version) pairs.
-
-        This is called as the result of a transaction.
-        """
-        for oid, version in args:
-            self._cache.invalidate(oid, version=version)
-            try:
-                self._db.invalidate(oid, version=version)
-            except AttributeError, msg:
-                log2(PROBLEM,
-                    "Invalidate(%s, %s) failed for _db: %s" % (repr(oid),
-                                                               repr(version),
-                                                               msg))
+        """Invalidate objects modified by tid."""
+        if self._pickler is not None:
+            self.log("Transactional invalidation during cache verification",
+                     level=zLOG.BLATHER)
+            for t in args:
+                self.self._pickler.dump(t)
+            return
+        self._process_invalidations(args)
 
     # Unfortunately, the ZEO 2 wire protocol uses different names for
     # several of the callback methods invoked by the StorageServer.




More information about the Zodb-checkins mailing list