[Zope-CVS] CVS: Products/Ape/lib/apelib/zodb3 - storage.py:1.12 zodbtables.py:1.3

Shane Hathaway shane at zope.com
Mon Mar 1 09:13:55 EST 2004


Update of /cvs-repository/Products/Ape/lib/apelib/zodb3
In directory cvs.zope.org:/tmp/cvs-serv24897/lib/apelib/zodb3

Modified Files:
	storage.py zodbtables.py 
Log Message:
Made shallowly compatible with the Zope head.

Deeper compabitility will take advantage of the refined ZODB
Connection class.



=== Products/Ape/lib/apelib/zodb3/storage.py 1.11 => 1.12 ===
--- Products/Ape/lib/apelib/zodb3/storage.py:1.11	Sat Feb 28 15:06:28 2004
+++ Products/Ape/lib/apelib/zodb3/storage.py	Mon Mar  1 09:13:54 2004
@@ -67,6 +67,11 @@
     def sortKey(self):
         return self._sort_key
 
+    def getTransactionId(self):
+        if hasattr(self, '_tid'):
+            return self._tid
+        return self._serial
+
     def initDatabases(self, clear_all=0):
         self._gwio.initDatabases(clear_all=clear_all)
 
@@ -149,10 +154,11 @@
             new_h64 = self.hash64(new_hash)
 
             # Remember that this OID changed (for scanning)
-            t = self.changed.get(self._serial)
+            tid = self.getTransactionId()
+            t = self.changed.get(tid)
             if t is None:
                 t = {}
-                self.changed[self._serial] = t
+                self.changed[tid] = t
             t[oid] = 1
         finally:
             self._lock_release()
@@ -178,8 +184,9 @@
     def _abort(self):
         for c in self._conn_list:
             c.abort()
-        if self.changed.has_key(self._serial):
-            del self.changed[self._serial]
+        tid = self.getTransactionId()
+        if self.changed.has_key(tid):
+            del self.changed[tid]
 
     def _begin(self, tid, u, d, e):
         for c in self._conn_list:
@@ -188,10 +195,11 @@
     def _finish(self, tid, user, desc, ext):
         for c in self._conn_list:
             c.finish()
-        self._ltid = self._serial
-        if self.changed.has_key(self._serial):
-            oids = self.changed[self._serial]
-            del self.changed[self._serial]
+        tid = self.getTransactionId()
+        self._ltid = tid
+        if self.changed.has_key(tid):
+            oids = self.changed[tid]
+            del self.changed[tid]
             if self.scanner:
                 for oid in oids:
                     sources = self._gwio.getPollSources(oid)


=== Products/Ape/lib/apelib/zodb3/zodbtables.py 1.2 => 1.3 ===
--- Products/Ape/lib/apelib/zodb3/zodbtables.py:1.2	Mon Feb  2 10:07:22 2004
+++ Products/Ape/lib/apelib/zodb3/zodbtables.py	Mon Mar  1 09:13:54 2004
@@ -16,7 +16,8 @@
 $Id$
 """
 
-from ZODB import Persistent
+import ZODB
+from Persistence import Persistent
 from BTrees.IIBTree import IITreeSet, intersection
 from BTrees.IOBTree import IOBTree
 from BTrees.OIBTree import OIBTree




More information about the Zope-CVS mailing list