Commit b23ca816 authored by Jim Fulton's avatar Jim Fulton

Check for and ignore objects with _p_jar attributes that are None.

parent 50d88b92
...@@ -84,8 +84,8 @@ ...@@ -84,8 +84,8 @@
############################################################################## ##############################################################################
"""Transaction management """Transaction management
$Id: Transaction.py,v 1.14 1999/08/11 15:20:28 jim Exp $""" $Id: Transaction.py,v 1.15 1999/08/11 17:44:28 jim Exp $"""
__version__='$Revision: 1.14 $'[11:-2] __version__='$Revision: 1.15 $'[11:-2]
import time, sys, struct, POSException import time, sys, struct, POSException
from struct import pack from struct import pack
...@@ -152,7 +152,7 @@ class Transaction: ...@@ -152,7 +152,7 @@ class Transaction:
for o in self._objects: for o in self._objects:
try: try:
j=getattr(o, '_p_jar', o) j=getattr(o, '_p_jar', o)
j.abort(o, self) if j is not None: j.abort(o, self)
except: except:
if t is None: if t is None:
t,v,tb=sys.exc_info() t,v,tb=sys.exc_info()
...@@ -225,6 +225,7 @@ class Transaction: ...@@ -225,6 +225,7 @@ class Transaction:
while objects: while objects:
o=objects[-1] o=objects[-1]
j=getattr(o, '_p_jar', o) j=getattr(o, '_p_jar', o)
if j is None: continue
i=id(j) i=id(j)
if not jars.has_key(i): if not jars.has_key(i):
jars[i]=j jars[i]=j
...@@ -255,7 +256,7 @@ class Transaction: ...@@ -255,7 +256,7 @@ class Transaction:
for o in objects: for o in objects:
try: try:
j=getattr(o, '_p_jar', o) j=getattr(o, '_p_jar', o)
j.abort(o, self) if j is not None: j.abort(o, self)
except: pass except: pass
# Then, we unwind TPC for the jars that began it. # Then, we unwind TPC for the jars that began it.
......
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