[Zodb-checkins] CVS: StandaloneZODB/ZEO - ClientStorage.py:1.35.6.5 ServerStub.py:1.3.2.2 StorageServer.py:1.32.6.5

Jeremy Hylton jeremy@zope.com
Fri, 18 Jan 2002 12:24:59 -0500


Update of /cvs-repository/StandaloneZODB/ZEO
In directory cvs.zope.org:/tmp/cvs-serv5025/ZEO

Modified Files:
      Tag: Standby-branch
	ClientStorage.py ServerStub.py StorageServer.py 
Log Message:
Add support for optional 2nd & 3rd args to tpc_begin().


=== StandaloneZODB/ZEO/ClientStorage.py 1.35.6.4 => 1.35.6.5 ===
         self.tpc_cond.release()
 
-    def tpc_begin(self, transaction):
+    def tpc_begin(self, transaction, tid=None, status=' '):
         self.tpc_cond.acquire()
         while self._transaction is not None:
             if self._transaction == transaction:
@@ -432,7 +432,8 @@
             r = self._server.tpc_begin(id,
                                        transaction.user,
                                        transaction.description,
-                                       transaction._extension)
+                                       transaction._extension,
+                                       tid, status)
         except:
             # Client may have disconnected during the tpc_begin().
             # Then notifyDisconnected() will have released the lock.


=== StandaloneZODB/ZEO/ServerStub.py 1.3.2.1 => 1.3.2.2 ===
         self.rpc.callAsync('storea', oid, serial, data, version, id)
 
-    def tpc_begin(self, id, user, descr, ext):
-        return self.rpc.call('tpc_begin', id, user, descr, ext)
+    def tpc_begin(self, id, user, descr, ext, tid, status):
+        return self.rpc.call('tpc_begin', id, user, descr, ext, tid, status)
 
     def vote(self, trans_id):
         return self.rpc.call('vote', trans_id)


=== StandaloneZODB/ZEO/StorageServer.py 1.32.6.4 => 1.32.6.5 ===
     # and continues from there.
 
-    def tpc_begin(self, id, user, description, ext):
+    def tpc_begin(self, id, user, description, ext, tid, status):
         if self._transaction is not None:
             if self._transaction.id == id:
                 self._log("duplicate tpc_begin(%s)" % repr(id))
@@ -418,11 +418,11 @@
 
         if self.__storage._transaction is not None:
             d = Delay()
-            self.__storage.__waiting.append((d, self, t))
+            self.__storage.__waiting.append((d, self, t, tid, status))
             return d
 
         self._transaction = t
-        self.__storage.tpc_begin(t)
+        self.__storage.tpc_begin(t, tid, status)
         self.__invalidated = []
 
     def tpc_finish(self, id):
@@ -451,17 +451,17 @@
             self._transaction = None
             self.__invalidated = []
 
-    def _restart_delayed_transaction(self, delay, trans):
+    def _restart_delayed_transaction(self, delay, trans, tid, status):
         self._transaction = trans
-        self.__storage.tpc_begin(trans)
+        self.__storage.tpc_begin(trans, tid, status)
         self.__invalidated = []
         assert self._transaction.id == self.__storage._transaction.id
         delay.reply(None)
 
     def _handle_waiting(self):
         if self.__storage.__waiting:
-            delay, proxy, trans = self.__storage.__waiting.pop(0)
-            proxy._restart_delayed_transaction(delay, trans)
+            delay, proxy, trans, tid, status = self.__storage.__waiting.pop(0)
+            proxy._restart_delayed_transaction(delay, trans, tid, status)
             if self is proxy:
                 return 1