[Zodb-checkins] CVS: ZODB3/ZODB - Connection.py:1.76.4.1.2.2

Jeremy Hylton jeremy@zope.com
Fri, 1 Nov 2002 14:42:15 -0500


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

Modified Files:
      Tag: ZODB3-deadlock-debug-branch
	Connection.py 
Log Message:
Grab the right sortKey() method in _setDB().

If a subtransaction is committed, self._storage won't point to the
real storage.


=== ZODB3/ZODB/Connection.py 1.76.4.1.2.1 => 1.76.4.1.2.2 ===
--- ZODB3/ZODB/Connection.py:1.76.4.1.2.1	Fri Nov  1 14:29:21 2002
+++ ZODB3/ZODB/Connection.py	Fri Nov  1 14:42:15 2002
@@ -193,7 +193,7 @@
 
     def sortKey(self):
         # XXX will raise an exception if the DB hasn't been set
-        return self._storage.sortKey()
+        return self._sortKey()
 
     def _setDB(self, odb):
         """Begin a new transaction.
@@ -202,6 +202,7 @@
         """
         self._db=odb
         self._storage=s=odb._storage
+        self._sortKey = odb._storage.sortKey
         self.new_oid=s.new_oid
         if self._code_timestamp != global_code_timestamp:
             # New code is in place.  Start a new cache.