~camptocamp/openobject-server/trunk-geoengine

« back to all changes in this revision

Viewing changes to openerp/sql_db.py

  • Committer: nicolas.bessi at camptocamp
  • Date: 2011-09-29 08:01:19 UTC
  • mfrom: (3575.1.98 trunk)
  • Revision ID: nicolas.bessi@camptocamp.com-20110929080119-dd1mtrue3ooxvhqh
[MRG] from trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
222
222
            params = params or None
223
223
            res = self._obj.execute(query, params)
224
224
        except psycopg2.ProgrammingError, pe:
225
 
            if self._default_log_exceptions or log_exceptions:
 
225
            if (self._default_log_exceptions if log_exceptions is None else log_exceptions):
226
226
                self.__logger.error("Programming error: %s, in query %s", pe, query)
227
227
            raise
228
228
        except Exception:
229
 
            if self._default_log_exceptions or log_exceptions:
 
229
            if (self._default_log_exceptions if log_exceptions is None else log_exceptions):
230
230
                self.__logger.exception("bad query: %s", self._obj.query or query)
231
231
            raise
232
232
 
512
512
    return Connection(_Pool, db_name)
513
513
 
514
514
def close_db(db_name):
515
 
    """ You might want to call openerp.netsvc.Agent.cancel(db_name) along this function."""
 
515
    """ You might want to call openerp.modules.registry.RegistryManager.delete(db_name) along this function."""
516
516
    _Pool.close_all(dsn(db_name))
517
517
    ct = currentThread()
518
518
    if hasattr(ct, 'dbname'):