[Zodb-checkins] CVS: Packages/ZEO - ClientStorage.py:1.31 StorageServer.py:1.26
jeremy@digicool.com
jeremy@digicool.com
Wed, 9 May 2001 12:03:19 -0400 (EDT)
Update of /cvs-repository/Packages/ZEO
In directory korak:/tmp/cvs-serv18529
Modified Files:
ClientStorage.py StorageServer.py
Log Message:
Add support for transactionalUndo
--- Updated File ClientStorage.py in package Packages/ZEO --
--- ClientStorage.py 2001/05/08 22:33:54 1.30
+++ ClientStorage.py 2001/05/09 16:03:19 1.31
@@ -429,6 +429,8 @@
def supportsUndo(self): return self._info['supportsUndo']
def supportsVersions(self): return self._info['supportsVersions']
+ def supportsTransactionalUndo(self):
+ return self._info['supportsTransactionalUndo']
def tpc_abort(self, transaction):
self._lock_acquire()
@@ -545,6 +547,18 @@
self._transaction=None
self._commit_lock_release()
+ finally: self._lock_release()
+
+ def transactionalUndo(self, trans_id, trans):
+ self._lock_acquire()
+ try:
+ if trans is not self._transaction:
+ raise POSException.StorageTransactionError(self, transaction)
+ oids = self._call('transactionalUndo', trans_id, self._serial)
+ for oid in oids:
+ # write invalidation records with no version
+ self._tfile.write("i%s\000\000" % oid)
+ return oids
finally: self._lock_release()
def undo(self, transaction_id):
--- Updated File StorageServer.py in package Packages/ZEO --
--- StorageServer.py 2001/05/08 21:14:03 1.25
+++ StorageServer.py 2001/05/09 16:03:19 1.26
@@ -201,6 +201,7 @@
'modifiedInVersion', 'new_oid', 'new_oids', 'pack', 'store',
'storea', 'tpc_abort', 'tpc_begin', 'tpc_begin_sync',
'tpc_finish', 'undo', 'undoLog', 'undoInfo', 'versionEmpty', 'versions',
+ 'transactionalUndo',
'vote', 'zeoLoad', 'zeoVerify', 'beginZeoVerify', 'endZeoVerify',
):
storage_methods[n]=1
@@ -320,6 +321,7 @@
'name': storage.getName(),
'supportsUndo': storage.supportsUndo(),
'supportsVersions': storage.supportsVersions(),
+ 'supportsTransactionalUndo': storage.supportsTransactionalUndo(),
}
def get_size_info(self):
@@ -451,6 +453,12 @@
if t is None or id != t.id:
raise POSException.StorageTransactionError(self, id)
return self.__storage.tpc_vote(t)
+
+ def transactionalUndo(self, trans_id, id):
+ t=self._transaction
+ if t is None or id != t.id:
+ raise POSException.StorageTransactionError(self, id)
+ return self.__storage.transactionalUndo(trans_id, self._transaction)
def undo(self, transaction_id):
oids=self.__storage.undo(transaction_id)