[MERGE] lp:924783 (fix dropping database before any connection, contrib from Ronald Portier)
bzr revid: rco@openerp.com-20120201130957-ra3ot62j0bbxjnu1
This commit is contained in:
commit
c86ddaad57
|
@ -509,8 +509,10 @@ def db_connect(db_name):
|
|||
return Connection(_Pool, db_name)
|
||||
|
||||
def close_db(db_name):
|
||||
global _Pool
|
||||
""" You might want to call openerp.modules.registry.RegistryManager.delete(db_name) along this function."""
|
||||
_Pool.close_all(dsn(db_name))
|
||||
if _Pool:
|
||||
_Pool.close_all(dsn(db_name))
|
||||
ct = currentThread()
|
||||
if hasattr(ct, 'dbname'):
|
||||
delattr(ct, 'dbname')
|
||||
|
|
Loading…
Reference in New Issue