Commit 8014adfe authored by Vincent Pelletier's avatar Vincent Pelletier

Update btree's deleteTransaction implementation to current API.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@2459 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent cde203ff
......@@ -383,15 +383,15 @@ class BTreeDatabaseManager(DatabaseManager):
else:
break
def deleteTransaction(self, tid, all=False):
def deleteTransaction(self, tid, oid_list=()):
tid = util.u64(tid)
self._popTransactionFromObj(self._tobj, tid)
try:
del self._ttrans[tid]
except KeyError:
pass
if all:
self._popTransactionFromObj(self._obj, tid)
for oid in oid_list:
self._deleteObject(oid, serial=tid)
try:
del self._trans[tid]
except KeyError:
......@@ -400,6 +400,11 @@ class BTreeDatabaseManager(DatabaseManager):
def deleteObject(self, oid, serial=None):
u64 = util.u64
oid = u64(oid)
if serial is not None:
serial = u64(serial)
self._deleteObject(oid, serial=serial)
def _deleteObject(self, oid, serial=None):
obj = self._obj
try:
tserial = obj[oid]
......@@ -409,7 +414,6 @@ class BTreeDatabaseManager(DatabaseManager):
if serial is None:
del obj[oid]
else:
serial = u64(serial)
try:
del tserial[serial]
except KeyError:
......
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