Commit f6b665bb authored by Jim Fulton's avatar Jim Fulton

Fixed a bug that occurs in cases when objects without _p_jar

attributes are registered.
parent 6e7e20ea
...@@ -84,8 +84,8 @@ ...@@ -84,8 +84,8 @@
############################################################################## ##############################################################################
"""Transaction management """Transaction management
$Id: Transaction.py,v 1.22 2000/05/30 19:03:27 jim Exp $""" $Id: Transaction.py,v 1.23 2000/06/05 11:04:32 jim Exp $"""
__version__='$Revision: 1.22 $'[11:-2] __version__='$Revision: 1.23 $'[11:-2]
import time, sys, struct, POSException import time, sys, struct, POSException
from struct import pack from struct import pack
...@@ -239,16 +239,16 @@ class Transaction: ...@@ -239,16 +239,16 @@ class Transaction:
try: try:
for o in objects: for o in objects:
j=getattr(o, '_p_jar', o) j=getattr(o, '_p_jar', o)
if j is None: continue if j is not None:
i=id(j) i=id(j)
if not jars.has_key(i): if not jars.has_key(i):
jars[i]=j jars[i]=j
if subtransaction: if subtransaction:
subj[i]=j subj[i]=j
j.tpc_begin(self, subtransaction) j.tpc_begin(self, subtransaction)
else: else:
j.tpc_begin(self) j.tpc_begin(self)
j.commit(o,self) j.commit(o,self)
ncommitted=ncommitted+1 ncommitted=ncommitted+1
# Commit work done in subtransactions # Commit work done in subtransactions
......
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