Commit 26dac5fa authored by Vincent Pelletier's avatar Vincent Pelletier

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.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@2620 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 6074dbdc
...@@ -67,6 +67,7 @@ class Transaction(object): ...@@ -67,6 +67,7 @@ class Transaction(object):
) )
def addCheckedObject(self, oid): def addCheckedObject(self, oid):
assert oid not in self._object_dict, dump(oid)
self._checked_set.add(oid) self._checked_set.add(oid)
def getTTID(self): def getTTID(self):
...@@ -101,11 +102,15 @@ class Transaction(object): ...@@ -101,11 +102,15 @@ class Transaction(object):
""" """
Add an object to the transaction Add an object to the transaction
""" """
assert oid not in self._checked_set, dump(oid)
self._object_dict[oid] = (oid, compression, checksum, data, self._object_dict[oid] = (oid, compression, checksum, data,
value_serial) value_serial)
def delObject(self, oid): 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): def getObject(self, oid):
return self._object_dict.get(oid) return self._object_dict.get(oid)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment