SVN: ZODB/branches/jim-readCurrent/src/ZODB/ Fixed the signature for checkCurrentSerialInTransaction.

Jim Fulton <[email protected]>
Newsgroups gmane.comp.python.zope.zodb.cvs
Message-ID <[email protected]>
Log message for revision 116061:
  Fixed the signature for checkCurrentSerialInTransaction.
  

Changed:
  U   ZODB/branches/jim-readCurrent/src/ZODB/Connection.py
  U   ZODB/branches/jim-readCurrent/src/ZODB/interfaces.py
  U   ZODB/branches/jim-readCurrent/src/ZODB/tests/testConnection.py

-=-
Modified: ZODB/branches/jim-readCurrent/src/ZODB/Connection.py
===================================================================
--- ZODB/branches/jim-readCurrent/src/ZODB/Connection.py	2010-08-31 09:55:40 UTC (rev 116060)
+++ ZODB/branches/jim-readCurrent/src/ZODB/Connection.py	2010-08-31 14:40:34 UTC (rev 116061)
@@ -557,7 +557,8 @@
             self._commit(transaction)
 
         for oid, serial in self._readCurrent.iteritems():
-            self._storage.checkCurrentSerialInTransaction(oid, serial)
+            self._storage.checkCurrentSerialInTransaction(
+                oid, serial, transaction)
 
     def _commit(self, transaction):
         """Commit changes to an object"""

Modified: ZODB/branches/jim-readCurrent/src/ZODB/interfaces.py
===================================================================
--- ZODB/branches/jim-readCurrent/src/ZODB/interfaces.py	2010-08-31 09:55:40 UTC (rev 116060)
+++ ZODB/branches/jim-readCurrent/src/ZODB/interfaces.py	2010-08-31 14:40:34 UTC (rev 116061)
@@ -1129,7 +1129,7 @@
 
 class ReadVerifyingStorage(IStorage):
 
-    def checkCurrentSerialInTransaction(oid, serial):
+    def checkCurrentSerialInTransaction(oid, serial, transaction):
         """Check whether the given serial number is current.
 
         The method is called during the first phase of 2-phase commit

Modified: ZODB/branches/jim-readCurrent/src/ZODB/tests/testConnection.py
===================================================================
--- ZODB/branches/jim-readCurrent/src/ZODB/tests/testConnection.py	2010-08-31 09:55:40 UTC (rev 116060)
+++ ZODB/branches/jim-readCurrent/src/ZODB/tests/testConnection.py	2010-08-31 14:40:34 UTC (rev 116061)
@@ -627,8 +627,9 @@
 
     >>> from ZODB.POSException import ConflictError
     >>> bad = set()
-    >>> def checkCurrentSerialInTransaction(oid, serial):
+    >>> def checkCurrentSerialInTransaction(oid, serial, trans):
     ...     print 'checkCurrentSerialInTransaction', `oid`
+    ...     if not trans == transaction.get(): print 'oops'
     ...     if oid in bad:
     ...         raise ConflictError(oid=oid)
 
@@ -691,7 +692,8 @@
 
 The storage may raise it later:
 
-    >>> def checkCurrentSerialInTransaction(oid, serial):
+    >>> def checkCurrentSerialInTransaction(oid, serial, trans):
+    ...     if not trans == transaction.get(): print 'oops'
     ...     print 'checkCurrentSerialInTransaction', `oid`
     ...     store.badness = ConflictError(oid=oid)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.