[Zodb-checkins] CVS: ZODB/src/ZEO - StorageServer.py:1.107
ServerStub.py:1.19 ClientStorage.py:1.120
Jeremy Hylton
jeremy at zope.com
Tue Feb 17 20:13:08 EST 2004
Update of /cvs-repository/ZODB/src/ZEO
In directory cvs.zope.org:/tmp/cvs-serv25077/src/ZEO
Modified Files:
StorageServer.py ServerStub.py ClientStorage.py
Log Message:
Rename transactionalUndo() to undo().
The old undo was not used by Zope and shouldn't have been used by any
other client. The newly named undo() is the preferred version of
undo.
XXX DemoStorage didn't implement transactionalUndo, so now it doesn't
implementation undo() at all. We need to replace it with the demo
storage from ZODB4.
There are a few changes related to ZODB4 removal in this checkin.
=== ZODB/src/ZEO/StorageServer.py 1.106 => 1.107 ===
--- ZODB/src/ZEO/StorageServer.py:1.106 Fri Jan 9 15:49:04 2004
+++ ZODB/src/ZEO/StorageServer.py Tue Feb 17 20:13:03 2004
@@ -222,8 +222,6 @@
'name': self.storage.getName(),
'supportsUndo': self.storage.supportsUndo(),
'supportsVersions': self.storage.supportsVersions(),
- 'supportsTransactionalUndo':
- self.storage.supportsTransactionalUndo(),
'extensionMethods': self.getExtensionMethods(),
}
@@ -348,16 +346,6 @@
n = 1
return [self.storage.new_oid() for i in range(n)]
- def undo(self, transaction_id):
- if self.read_only:
- raise ReadOnlyError()
- oids = self.storage.undo(transaction_id)
- if oids:
- self.server.invalidate(self, self.storage_id, None,
- map(lambda oid: (oid, ''), oids))
- return oids
- return ()
-
# undoLog and undoInfo are potentially slow methods
def undoInfo(self, first, last, spec):
@@ -480,12 +468,12 @@
else:
return self._wait(lambda: self._commitVersion(src, dest))
- def transactionalUndo(self, trans_id, id):
+ def undo(self, trans_id, id):
self._check_tid(id, exc=StorageTransactionError)
if self.locked:
- return self._transactionalUndo(trans_id)
+ return self._undo(trans_id)
else:
- return self._wait(lambda: self._transactionalUndo(trans_id))
+ return self._wait(lambda: self._undo(trans_id))
def _tpc_begin(self, txn, tid, status):
self.locked = 1
@@ -557,8 +545,8 @@
self.invalidated.extend(inv)
return tid, oids
- def _transactionalUndo(self, trans_id):
- tid, oids = self.storage.transactionalUndo(trans_id, self.transaction)
+ def _undo(self, trans_id):
+ tid, oids = self.storage.undo(trans_id, self.transaction)
inv = [(oid, None) for oid in oids]
self.invalidated.extend(inv)
return tid, oids
=== ZODB/src/ZEO/ServerStub.py 1.18 => 1.19 ===
--- ZODB/src/ZEO/ServerStub.py:1.18 Wed Dec 24 11:02:03 2003
+++ ZODB/src/ZEO/ServerStub.py Tue Feb 17 20:13:03 2004
@@ -268,11 +268,8 @@
def store(self, oid, serial, data, version, trans):
return self.rpc.call('store', oid, serial, data, version, trans)
- def transactionalUndo(self, trans_id, trans):
- return self.rpc.call('transactionalUndo', trans_id, trans)
-
- def undo(self, trans_id):
- return self.rpc.call('undo', trans_id)
+ def undo(self, trans_id, trans):
+ return self.rpc.call('undo', trans_id, trans)
def undoLog(self, first, last):
return self.rpc.call('undoLog', first, last)
=== ZODB/src/ZEO/ClientStorage.py 1.119 => 1.120 ===
--- ZODB/src/ZEO/ClientStorage.py:1.119 Tue Jan 6 16:11:43 2004
+++ ZODB/src/ZEO/ClientStorage.py Tue Feb 17 20:13:03 2004
@@ -994,7 +994,7 @@
self._cache.store(oid, version, s, None, data)
self._tbuf.clear()
- def transactionalUndo(self, trans_id, txn):
+ def undo(self, trans_id, txn):
"""Storage API: undo a transaction.
This is executed in a transactional context. It has no effect
@@ -1004,7 +1004,7 @@
a storage.
"""
self._check_trans(txn)
- tid, oids = self._server.transactionalUndo(trans_id, id(txn))
+ tid, oids = self._server.undo(trans_id, id(txn))
for oid in oids:
self._tbuf.invalidate(oid, '')
return tid, oids
More information about the Zodb-checkins
mailing list