Commit 0a7e7680 authored by Barry Warsaw's avatar Barry Warsaw

Port forward from ZODB 3.1.1 disabling the hosed state. Added an XXX

comment describing Jim's desire to reach into ZConfig to decide
whether we should enter the hosed state or not.
parent db3f6edc
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
############################################################################## ##############################################################################
"""Transaction management """Transaction management
$Id: Transaction.py,v 1.46 2003/01/02 18:05:47 shane Exp $ $Id: Transaction.py,v 1.47 2003/01/27 20:30:45 bwarsaw Exp $
""" """
import time, sys, struct, POSException import time, sys, struct, POSException
...@@ -255,7 +255,6 @@ class Transaction: ...@@ -255,7 +255,6 @@ class Transaction:
# have to clean up. First save the original exception # have to clean up. First save the original exception
# in case the cleanup process causes another # in case the cleanup process causes another
# exception. # exception.
t, v, tb = sys.exc_info()
try: try:
self._commit_error(objects, ncommitted, jars, subjars) self._commit_error(objects, ncommitted, jars, subjars)
except: except:
...@@ -263,8 +262,7 @@ class Transaction: ...@@ -263,8 +262,7 @@ class Transaction:
"A storage error occured during transaction " "A storage error occured during transaction "
"abort. This shouldn't happen.", "abort. This shouldn't happen.",
error=sys.exc_info()) error=sys.exc_info())
raise
raise t, v, tb
finally: finally:
del objects[:] # clear registered del objects[:] # clear registered
if not subtransaction and self._id is not None: if not subtransaction and self._id is not None:
...@@ -356,7 +354,7 @@ class Transaction: ...@@ -356,7 +354,7 @@ class Transaction:
jar.tpc_finish(self) jar.tpc_finish(self)
except: except:
# Bug if it does, we need to keep track of it # Bug if it does, we need to keep track of it
LOG('ZODB', ERROR, LOG('ZODB', PANIC,
"A storage error occurred in the last phase of a " "A storage error occurred in the last phase of a "
"two-phase commit. This shouldn\'t happen. ", "two-phase commit. This shouldn\'t happen. ",
error=sys.exc_info()) error=sys.exc_info())
...@@ -369,7 +367,9 @@ class Transaction: ...@@ -369,7 +367,9 @@ class Transaction:
# The database can't guarantee consistency if call fails. # The database can't guarantee consistency if call fails.
jar.tpc_finish(self) jar.tpc_finish(self)
except: except:
hosed = 1 # XXX We should consult ZConfig to decide whether we want to put
# the transaction manager in a hosed state or not.
#hosed = 1
LOG('ZODB', PANIC, LOG('ZODB', PANIC,
"A storage error occurred in the last phase of a " "A storage error occurred in the last phase of a "
"two-phase commit. This shouldn\'t happen. " "two-phase commit. This shouldn\'t happen. "
......
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