Commit f9900afe authored by Tim Peters's avatar Tim Peters

Added XXX comments about stray output produced by

testExceptionInTpcAbort().  The cause is clear now, but a solution isn't;
an exception in tpc_abort is nasty.
parent 6cbbbdd3
......@@ -36,7 +36,7 @@ TODO
add in tests for objects which are modified multiple times,
for example an object that gets modified in multiple sub txns.
$Id: testTransaction.py,v 1.21 2004/04/02 19:31:32 tim_one Exp $
$Id: testTransaction.py,v 1.22 2004/04/02 19:48:22 tim_one Exp $
"""
import unittest
......@@ -385,6 +385,9 @@ class TransactionTests(unittest.TestCase):
self.sub1.modify(nojar=1)
try:
# XXX Transaction._cleanup() prints a stray "error tpc_abort"
# XXX (the string value of the TestTxnException instance raised)
# XXX to stdout.
get_transaction().commit()
except TestTxnException:
pass
......
......@@ -324,11 +324,13 @@ class Transaction(object):
try:
rm.abort_sub(self)
except Exception, err:
# XXX Just printing the error doesn't seem good enough.
print err
else:
try:
rm.tpc_abort(self)
except Exception, err:
# XXX Just printing the error doesn't seem good enough.
print err
def _getResourceManagers(self, subtransaction):
......@@ -498,7 +500,7 @@ class MultiObjectResourceAdapterSub(MultiObjectResourceAdapter):
self.manager.tpc_finish(txn)
if self.sub:
self.objects = []
def rm_cmp(rm1, rm2):
return cmp(rm1.sortKey(), rm2.sortKey())
......@@ -534,7 +536,7 @@ class DataManagerAdapter(object):
def __init__(self, datamanager):
self._datamanager = datamanager
self._rollback = None
# XXX I'm not sure why commit() doesn't do anything
def commit(self, transaction):
......@@ -558,7 +560,7 @@ class DataManagerAdapter(object):
# Nothing to do wrt data, be we begin 2pc for the top-level
# trans
self._sub = False
def tpc_begin(self, transaction, subtransaction=False):
self._sub = subtransaction
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment