[Zodb-checkins] CVS: Packages/ZODB - Transaction.py:22.214.171.124
tim.one at comcast.net
Wed Aug 25 15:18:00 EDT 2004
Update of /cvs-repository/Packages/ZODB
In directory cvs.zope.org:/tmp/cvs-serv23647/lib/python/ZODB
Transaction.begin() should imply abort().
But didn't, if the only changes pending were in subtransactions. Now it
does, + new checkTxnBeginImpliesAbort test to ensure it stays fixed.
=== Packages/ZODB/Transaction.py 126.96.36.199 => 188.8.131.52 ===
--- Packages/ZODB/Transaction.py:184.108.40.206 Wed Jun 9 14:42:08 2004
+++ Packages/ZODB/Transaction.py Wed Aug 25 15:17:30 2004
@@ -51,14 +51,19 @@
description = ''
_connections = None
_extension = None
- _sub = None # This is a subtrasaction flag
+ # If there's a subtransaction commit, _sub becomes a dict mapping
+ # id(jar) to jar, for each jar among the registered objects such
+ # that jar.commit_sub exists. So _sub.values() is the set of jars
+ # that know how to participate in subtransactions.
+ _sub = None
# The _non_st_objects variable is either None or a list
# of jars that do not support subtransactions. This is used to
# manage non-subtransaction-supporting jars during subtransaction
# commits and aborts to ensure that they are correctly committed
# or aborted in the "outside" transaction.
+ _non_st_objects = None
def __init__(self, id=None):
@@ -167,9 +172,9 @@
def begin(self, info=None, subtransaction=None):
"""Begin a new transaction.
- This aborts any transaction in progres.
+ This aborts any transaction in progress.
- if self._objects:
+ if self._objects or self._sub or self._non_st_objects:
More information about the Zodb-checkins