Commit 5c5ca791 authored by Jim Fulton's avatar Jim Fulton

Fixed a bug that caused objects to be left in an invalid state

when tpc_begin failed.
parent 4b3ea677
...@@ -84,8 +84,8 @@ ...@@ -84,8 +84,8 @@
############################################################################## ##############################################################################
"""Transaction management """Transaction management
$Id: Transaction.py,v 1.18 2000/05/05 19:55:19 jim Exp $""" $Id: Transaction.py,v 1.19 2000/05/09 19:03:53 jim Exp $"""
__version__='$Revision: 1.18 $'[11:-2] __version__='$Revision: 1.19 $'[11:-2]
import time, sys, struct, POSException import time, sys, struct, POSException
from struct import pack from struct import pack
...@@ -223,7 +223,7 @@ class Transaction: ...@@ -223,7 +223,7 @@ class Transaction:
try: try:
try: try:
while objects: while objects:
o=objects.pop() o=objects[-1]
j=getattr(o, '_p_jar', o) j=getattr(o, '_p_jar', o)
if j is None: continue if j is None: continue
i=id(j) i=id(j)
...@@ -235,6 +235,7 @@ class Transaction: ...@@ -235,6 +235,7 @@ class Transaction:
else: else:
j.tpc_begin(self) j.tpc_begin(self)
j.commit(o,self) j.commit(o,self)
del objects[-1]
# Commit work done in subtransactions # Commit work done in subtransactions
while subjars: while subjars:
......
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