[Zope3-checkins] CVS: Zope3/src/transaction - _manager.py:1.1.2.2 _transaction.py:1.1.2.7

Tim Peters tim.one at comcast.net
Fri Mar 19 16:07:15 EST 2004


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

Modified Files:
      Tag: jeremy-txn-branch
	_manager.py _transaction.py 
Log Message:
Various cleanups & teensy fixes.


=== Zope3/src/transaction/_manager.py 1.1.2.1 => 1.1.2.2 ===
--- Zope3/src/transaction/_manager.py:1.1.2.1	Thu Mar 18 16:18:33 2004
+++ Zope3/src/transaction/_manager.py	Fri Mar 19 16:07:13 2004
@@ -30,12 +30,13 @@
     def __init__(self):
         # _threads maps thread ids to transactions
         self._txns = {}
-        # _synchs maps thread ids to a list registered synchronizers.
+        # _synchs maps a thread id to a list of registered synchronizers.
         # The list is passed to the Transaction constructor, because
         # it needs to call the synchronizers when it commits.
         self._synchs = {}
 
     def begin(self):
+        tid = thread.get_ident()
         txn = self._txns.get(tid)
         if txn is not None:
             txn.abort()


=== Zope3/src/transaction/_transaction.py 1.1.2.6 => 1.1.2.7 ===
--- Zope3/src/transaction/_transaction.py:1.1.2.6	Fri Mar 19 15:52:58 2004
+++ Zope3/src/transaction/_transaction.py	Fri Mar 19 16:07:13 2004
@@ -96,10 +96,11 @@
 class Transaction(object):
 
     def __init__(self, synchronizers, manager):
+        # List of resource managers, e.g. ObjectAdapters.
         self._resources = []
         self._synchronizers = synchronizers or []
         self._manager = manager
-        self._adapters = {}
+        self._adapters = {} # Connection/_p_jar -> ObjectAdapter[Sub]
 
         # The user, description, and _extension attributes are accessed
         # directory by storages, leading underscore notwithstanding.
@@ -111,18 +112,17 @@
         self.log.debug("new transaction")
 
         # _sub contains all of the resource managers involved in
-        # subtransactions
+        # subtransactions.  It maps id(a resource manager) to the resource
+        # manager.
         self._sub = {}
-        # _nonsub contains all the resource managers that do not
-        # support subtransactions that were involved in
-        # subtransaction commits.
+        # _nonsub contains all the resource managers that do not support
+        # subtransactions that were involved in subtransaction commits.
         self._nonsub = {}
 
     def join(self, resource):
         self._resources.append(resource)
 
     def register(self, obj):
-        # XXX This would result in multiple adapters for subtransactions.
         adapter = self._adapters.get(obj._p_jar)
         if adapter is None:
             if myhasattr(obj._p_jar, "commit_sub"):




More information about the Zope3-Checkins mailing list