[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:
parent
0acbf9038f
commit
82d17ed77b
|
@ -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()
|
||||
|
||||
#
|
||||
|
|
|
@ -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()
|
||||
|
||||
|
|
Loading…
Reference in New Issue