Test if there is a connection on the transaction before rollback or put
--HG-- branch : 7.0
This commit is contained in:
@@ -254,8 +254,9 @@ class Transaction(object):
|
||||
else:
|
||||
self.rollback()
|
||||
finally:
|
||||
self.database.put_connection(
|
||||
self.connection, self.close)
|
||||
if self.connection:
|
||||
self.database.put_connection(
|
||||
self.connection, self.close)
|
||||
finally:
|
||||
self.database = None
|
||||
self.readonly = False
|
||||
@@ -379,7 +380,8 @@ class Transaction(object):
|
||||
datamanager.tpc_abort(self)
|
||||
Cache.rollback(self)
|
||||
self._clear_log_records()
|
||||
self.connection.rollback()
|
||||
if self.connection:
|
||||
self.connection.rollback()
|
||||
|
||||
def join(self, datamanager):
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user