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')