[Zope3-checkins] CVS: Zope3/src/transaction - _transaction.py:1.1.2.27

Jeremy Hylton jeremy at zope.com
Mon Mar 29 12:03:13 EST 2004


Update of /cvs-repository/Zope3/src/transaction
In directory cvs.zope.org:/tmp/cvs-serv9429/src/transaction

Modified Files:
      Tag: jeremy-txn-branch
	_transaction.py 
Log Message:
Add a commit() method separate from tpc_vote() in Transaction.

For a subtransaction commit, we want to call commit(obj, txn) for each
object in the transaction, even though we don't want to call
tpc_vote().


=== Zope3/src/transaction/_transaction.py 1.1.2.26 => 1.1.2.27 ===
--- Zope3/src/transaction/_transaction.py:1.1.2.26	Mon Mar 29 11:39:05 2004
+++ Zope3/src/transaction/_transaction.py	Mon Mar 29 12:03:13 2004
@@ -216,6 +216,8 @@
                     rm.commit_sub(self)
                 else:
                     rm.tpc_begin(self, subtransaction)
+            for rm in L:
+                rm.commit(self)
             if not subtransaction:
                 # Not sure why, but it is intentional that you do not
                 # call tpc_vote() for subtransaction commits.
@@ -378,10 +380,12 @@
         self.objects = []
         self.ncommitted = 0
 
-    def tpc_vote(self, txn):
+    def commit(self, txn):
         for o in self.objects:
             self.manager.commit(o, txn)
             self.ncommitted += 1
+
+    def tpc_vote(self, txn):
         self.manager.tpc_vote(txn)
 
     def cleanup(self, txn):




More information about the Zope3-Checkins mailing list