~openerp-dev/openobject-server/saas-3-bug_1291322-ptr

« back to all changes in this revision

Viewing changes to openerp/sql_db.py

  • Committer: Kersten Jeremy
  • Date: 2014-04-09 15:16:59 UTC
  • mto: (4743.1.543 trunk)
  • mto: This revision was merged to the branch mainline in revision 5114.
  • Revision ID: jke@openerp.com-20140409151659-xwttchbtbj02v1w7
[FIX] Allow missing opcodes, harden check for private attributes (dunder), check inside embedded code objects.

Show diffs side-by-side

added added

removed removed

Lines of Context:
172
172
        self.sql_log_count = 0
173
173
        self.__closed = True    # avoid the call of close() (by __del__) if an exception
174
174
                                # is raised by any of the following initialisations
175
 
        self._pool = pool
 
175
        self.__pool = pool
176
176
        self.dbname = dbname
177
177
 
178
178
        # Whether to enable snapshot isolation level for this cursor.
318
318
            chosen_template = tools.config['db_template']
319
319
            templates_list = tuple(set(['template0', 'template1', 'postgres', chosen_template]))
320
320
            keep_in_pool = self.dbname not in templates_list
321
 
            self._pool.give_back(self._cnx, keep_in_pool=keep_in_pool)
 
321
            self.__pool.give_back(self._cnx, keep_in_pool=keep_in_pool)
322
322
 
323
323
    @check
324
324
    def autocommit(self, on):
476
476
 
477
477
    def __init__(self, pool, dbname):
478
478
        self.dbname = dbname
479
 
        self._pool = pool
 
479
        self.__pool = pool
480
480
 
481
481
    def cursor(self, serialized=True):
482
482
        cursor_type = serialized and 'serialized ' or ''
483
483
        _logger.debug('create %scursor to %r', cursor_type, self.dbname)
484
 
        return Cursor(self._pool, self.dbname, serialized=serialized)
 
484
        return Cursor(self.__pool, self.dbname, serialized=serialized)
485
485
 
486
486
    # serialized_cursor is deprecated - cursors are serialized by default
487
487
    serialized_cursor = cursor