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

Jeremy Hylton jeremy@zope.com
Tue, 17 Dec 2002 14:07:48 -0500


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

Modified Files:
      Tag: ZODB3-fast-restart-branch
	ClientStorage.py 
Log Message:
Make sure _tbuf.clear() is called!
Add invalidateTransaction() implementation.
Improve logging in verify_cache().


=== ZODB3/ZEO/ClientStorage.py 1.73.2.7.2.2 => 1.73.2.7.2.3 ===
--- ZODB3/ZEO/ClientStorage.py:1.73.2.7.2.2	Tue Dec 17 13:32:37 2002
+++ ZODB3/ZEO/ClientStorage.py	Tue Dec 17 14:07:48 2002
@@ -397,10 +397,16 @@
         # XXX beginZeoVerify ends up calling back to beginVerify() below.
         # That whole exchange is rather unnecessary.
         if self._last_inval_tid is not None:
-            if server.lastTransaction() == self._last_inval_tid:
+            ltid = server.lastTransaction()
+            if ltid == self._last_inval_tid:
                 log2(INFO, "No verification necessary "
                      "(_last_inval_tid up-to-date)")
                 return # No need to verify the cache
+            log2(INFO, "last inval tid: %r %s"
+                 % (self._last_inval_tid,
+                    str(TimeStamp(self._last_inval_tid))))
+            log2(INFO, "last transaction: %r %s"
+                 % (ltid, str(TimeStamp(ltid))))
         log2(INFO, "Verifying cache")
         server.beginZeoVerify()
         self._cache.verify(server.zeoVerify)
@@ -648,6 +654,7 @@
         self._serial = id
         self._seriald.clear()
         del self._serials[:]
+        self._tbuf.clear()
 
     def end_transaction(self):
         """Internal helper to end a transaction."""
@@ -820,6 +827,10 @@
             self._db.invalidate(oid, version=version)
         f.close()
 
+    def invalidateTransaction(self, tid, args):
+        self._last_inval_tid = tid
+        self.invalidateTrans(args)
+        
     def invalidateTrans(self, args):
         """Server callback to invalidate a list of (oid, version) pairs.