[Zodb-checkins] CVS: Packages/ZEO - ClientStorage.py:1.26.4.17

jeremy@digicool.com jeremy@digicool.com
Wed, 2 May 2001 16:44:22 -0400 (EDT)


Update of /cvs-repository/Packages/ZEO
In directory korak:/tmp/cvs-serv18647

Modified Files:
      Tag: ZEO-ZRPC-Dev
	ClientStorage.py 
Log Message:
Clean up some aliasing in cache invalidation code.
Note that last XXX comment in doc string says "it would be nice" which
is another way of saying "the code wouldn't be buggy if" :-)



--- Updated File ClientStorage.py in package Packages/ZEO --
--- ClientStorage.py	2001/05/01 18:39:27	1.26.4.16
+++ ClientStorage.py	2001/05/02 20:44:20	1.26.4.17
@@ -84,8 +84,11 @@
 ##############################################################################
 """Network ZODB storage client
 
-XXX support multiple outstanding requests up until the vote
+XXX support multiple outstanding requests up until the vote?
 XXX is_connected() vis ClientDisconnected error
+XXX it would be better to avoid invalidating for abortVersion,
+    commitVersion, transactionalUndo until the transaction actually
+    commits.
 """
 __version__='$Revision$'[11:-2]
 
@@ -313,9 +316,8 @@
         self._check_trans(transaction,
                           POSException.StorageTransactionError)
         oids = self._server.abortVersion(src, self._serial)
-        invalidate = self._cache.invalidate
         for oid in oids:
-            invalidate(oid, src)
+            self._cache.invalidate(oid, src)
         return oids
 
     def close(self):
@@ -328,15 +330,14 @@
         self._check_trans(transaction,
                           POSException.StorageTransactionError)
         oids = self._server.commitVersion(src, dest, self._serial)
-        invalidate = self._cache.invalidate
         if dest:
             # just invalidate our version data
             for oid in oids:
-                invalidate(oid, src)
+                self._cache.invalidate(oid, src)
         else:
             # dest is '', so invalidate version and non-version
             for oid in oids:
-                invalidate(oid, dest)
+                self._cache.invalidate(oid, dest)
         return oids
 
     def history(self, oid, version, length=1):
@@ -497,9 +498,8 @@
 
     def undo(self, transaction_id):
         oids = self._server.undo(transaction_id)
-        cinvalidate = self._cache.invalidate
         for oid in oids:
-            cinvalidate(oid, '')                
+            self._cache.invalidate(oid, '')                
         return oids
 
     def undoInfo(self, first=0, last=-20, specification=None):