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

Jeremy Hylton jeremy at zope.com
Mon Mar 22 17:00:04 EST 2004


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

Modified Files:
      Tag: jeremy-txn-branch
	_transaction.py 
Log Message:
If an error occurs committing a transaction, we try to revert the
changes in each of the resource managers.  For top-level transactions,
it must be freed from the txn manager.


=== Zope3/src/transaction/_transaction.py 1.1.2.20 => 1.1.2.21 ===
--- Zope3/src/transaction/_transaction.py:1.1.2.20	Mon Mar 22 16:45:01 2004
+++ Zope3/src/transaction/_transaction.py	Mon Mar 22 17:00:03 2004
@@ -215,7 +215,14 @@
             for rm in L:
                 rm.tpc_finish(self)
         except:
+            # If an error occurs committing a transaction, we try
+            # to revert the changes in each of the resource managers.
+            # For top-level transactions, it must be freed from the
+            # txn manager.
             self._cleanup(L)
+            if not subtransaction:
+                self.status = Status.FAILED
+                self._manager.free(self)
             raise
 
     def _cleanup(self, L):




More information about the Zope3-Checkins mailing list