[FIX] bug 375361: ensure the db transaction is closed when closing the cursor

lp bug: https://launchpad.net/bugs/375361 fixed

bzr revid: christophe@tinyerp.com-20090520150238-w18k3aitqzpmw5nm
This commit is contained in:
Christophe Simonis 2009-05-20 17:02:38 +02:00
parent 0acbf9038f
commit 82d17ed77b
2 changed files with 2 additions and 3 deletions

View File

@ -107,10 +107,8 @@ class ir_cron(osv.osv, netsvc.Agent):
addsql = ', active=False'
cr.execute("update ir_cron set nextcall=%s, numbercall=%s"+addsql+" where id=%s", (nextcall.strftime('%Y-%m-%d %H:%M:%S'), numbercall, job['id']))
cr.commit()
cr.commit()
except Exception,e:
cr.rollback()
finally:
cr.commit()
cr.close()
#

View File

@ -159,6 +159,7 @@ class Cursor(object):
@check
def close(self):
self.rollback() # Ensure we close the current transaction.
self.print_log()
self._obj.close()