[Zope-Checkins] CVS: ZODB3/ZODB - MappingStorage.py:1.9.40.1

Jeremy Hylton cvs-admin at zope.org
Wed Nov 5 23:33:45 EST 2003


Update of /cvs-repository/ZODB3/ZODB
In directory cvs.zope.org:/tmp/cvs-serv28251/ZODB

Modified Files:
      Tag: ZODB3-mvcc-2-branch
	MappingStorage.py 
Log Message:
Add loadEx() call that returns data, serial, and tid.

Th new ZEO cache is going to need the tid associated with an object in
addition to its serial number, since it can't guarantee that they are
the same.

The new tests fail for storages other that File and Mapping, because I
haven't implemented loadEx() for them.


=== ZODB3/ZODB/MappingStorage.py 1.9 => 1.9.40.1 ===
--- ZODB3/ZODB/MappingStorage.py:1.9	Mon Jan 13 19:12:14 2003
+++ ZODB3/ZODB/MappingStorage.py	Wed Nov  5 23:33:45 2003
@@ -58,6 +58,17 @@
         finally:
             self._lock_release()
 
+    def loadEx(self, oid, version):
+        self._lock_acquire()
+        try:
+            # Since this storage doesn't support versions, tid and
+            # serial will always be the same.
+            p = self._index[oid]
+            return p[8:], p[:8], p[:8] # pickle, serial, tid
+        finally:
+            self._lock_release()
+        
+
     def store(self, oid, serial, data, version, transaction):
         if transaction is not self._transaction:
             raise POSException.StorageTransactionError(self, transaction)
@@ -74,7 +85,7 @@
                     raise POSException.ConflictError(serials=(oserial, serial))
 
             serial = self._serial
-            self._tindex.append((oid, serial+data))
+            self._tindex.append((oid, serial + data))
         finally:
             self._lock_release()
         return serial




More information about the Zope-Checkins mailing list