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

Tim Peters tim.one at comcast.net
Fri Mar 19 16:20:09 EST 2004


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

Modified Files:
      Tag: jeremy-txn-branch
	_transaction.py 
Log Message:
_cleanup() buglet.


=== Zope3/src/transaction/_transaction.py 1.1.2.7 => 1.1.2.8 ===
--- Zope3/src/transaction/_transaction.py:1.1.2.7	Fri Mar 19 16:07:13 2004
+++ Zope3/src/transaction/_transaction.py	Fri Mar 19 16:20:09 2004
@@ -103,7 +103,7 @@
         self._adapters = {} # Connection/_p_jar -> ObjectAdapter[Sub]
 
         # The user, description, and _extension attributes are accessed
-        # directory by storages, leading underscore notwithstanding.
+        # directly by storages, leading underscore notwithstanding.
         self.user = ""
         self.description = ""
         self._extension = {}
@@ -164,7 +164,7 @@
         try:
             for rm in L:
                 # If you pass subtransaction=True to tpc_begin(), it
-                # will create a temporary storage for the during of
+                # will create a temporary storage for the duration of
                 # the transaction.  To signal that the top-level
                 # transaction is committing, you must then call
                 # commit_sub().
@@ -175,19 +175,17 @@
                 else:
                     print "tpc_begin", subtransaction, rm
                     rm.tpc_begin(self, subtransaction)
-                    # XXX what if rm doesn't support subtransactions?
             if not subtransaction:
                 # Not sure why, but it is intentional that you do not
                 # call tpc_vote() for subtransaction commits.
                 for rm in L:
                     rm.tpc_vote(self)
+            for rm in L:
+                rm.tpc_finish(self)
         except:
             print self._sub.keys()
             self._cleanup(L)
             raise
-        else:
-            for rm in L:
-                rm.tpc_finish(self)
 
     def _cleanup(self, L):
         # Called when an exception occurs during tpc_vote or tpc_finish.
@@ -195,7 +193,7 @@
             if not rm.voted:
                 rm.cleanup(self)
         for rm in L:
-            if rm in self._sub:
+            if id(rm) in self._sub:
                 print "cleanup", rm, "abort_sub"
                 try:
                     rm.abort_sub(self)




More information about the Zope3-Checkins mailing list