[Neo-report] r2620 vincent - /trunk/neo/storage/transactions.py

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Jan 19 15:15:21 CET 2011


Author: vincent
Date: Wed Jan 19 15:15:20 2011
New Revision: 2620

Log:
delObject must also clean _checked_set.

Still raises if deleted oid is in neither.
There should never be the same oid in both, as per ZODB implementation, so put
assertions to verify this.

Modified:
    trunk/neo/storage/transactions.py

Modified: trunk/neo/storage/transactions.py
==============================================================================
--- trunk/neo/storage/transactions.py [iso-8859-1] (original)
+++ trunk/neo/storage/transactions.py [iso-8859-1] Wed Jan 19 15:15:20 2011
@@ -67,6 +67,7 @@ class Transaction(object):
         )
 
     def addCheckedObject(self, oid):
+        assert oid not in self._object_dict, dump(oid)
         self._checked_set.add(oid)
 
     def getTTID(self):
@@ -101,11 +102,15 @@ class Transaction(object):
         """
             Add an object to the transaction
         """
+        assert oid not in self._checked_set, dump(oid)
         self._object_dict[oid] = (oid, compression, checksum, data,
             value_serial)
 
     def delObject(self, oid):
-        del self._object_dict[oid]
+        try:
+            del self._object_dict[oid]
+        except KeyError:
+            self._checked_set.remove(oid)
 
     def getObject(self, oid):
         return self._object_dict.get(oid)




More information about the Neo-report mailing list