[Zope3-checkins] CVS: Zope3/src/ZODB - DB.py:1.71.2.1

Jeremy Hylton jeremy at zope.com
Mon Mar 22 16:37:23 EST 2004


Update of /cvs-repository/Zope3/src/ZODB
In directory cvs.zope.org:/tmp/cvs-serv11208

Modified Files:
      Tag: jeremy-txn-branch
	DB.py 
Log Message:
Provide a saner tpc_begin() for ResourceManager.

tpc_begin() is a method on resource managers and on storages, but has
subtly different semantics for the different interfaces.


=== Zope3/src/ZODB/DB.py 1.71 => 1.71.2.1 ===
--- Zope3/src/ZODB/DB.py:1.71	Tue Mar 16 11:28:19 2004
+++ Zope3/src/ZODB/DB.py	Mon Mar 22 16:37:22 2004
@@ -663,13 +663,18 @@
     def __init__(self, db):
         self._db = db
         # Delegate the actual 2PC methods to the storage
-        self.tpc_begin = self._db._storage.tpc_begin
         self.tpc_vote = self._db._storage.tpc_vote
         self.tpc_finish = self._db._storage.tpc_finish
         self.tpc_abort = self._db._storage.tpc_abort
 
     def sortKey(self):
         return "%s:%s" % (self._db._storage.sortKey(), id(self))
+
+    def tpc_begin(self, txn, sub=False):
+        # XXX we should never be called with sub=True.
+        if sub:
+            raise ValueError, "doesn't supoprt sub-transactions"
+        self._db._storage.tpc_begin(txn)
 
     # The object registers itself with the txn manager, so the ob
     # argument to the methods below is self.




More information about the Zope3-Checkins mailing list