~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:35:27 UTC
  • mfrom: (4743.1.535 7.0)
  • Revision ID: jke@openerp.com-20140409153527-mic1a8afcvdhsd27
[MERGE] Forward port of branch 7.0 up to rev 5278 rev-id jke@openerp.com-20140409151659-xwttchbtbj02v1w7

Show diffs side-by-side

added added

removed removed

Lines of Context:
167
167
        self.sql_log_count = 0
168
168
        self.__closed = True    # avoid the call of close() (by __del__) if an exception
169
169
                                # is raised by any of the following initialisations
170
 
        self._pool = pool
 
170
        self.__pool = pool
171
171
        self.dbname = dbname
172
172
 
173
173
        # Whether to enable snapshot isolation level for this cursor.
313
313
            chosen_template = tools.config['db_template']
314
314
            templates_list = tuple(set(['template0', 'template1', 'postgres', chosen_template]))
315
315
            keep_in_pool = self.dbname not in templates_list
316
 
            self._pool.give_back(self._cnx, keep_in_pool=keep_in_pool)
 
316
            self.__pool.give_back(self._cnx, keep_in_pool=keep_in_pool)
317
317
 
318
318
    @check
319
319
    def autocommit(self, on):
484
484
 
485
485
    def __init__(self, pool, dbname):
486
486
        self.dbname = dbname
487
 
        self._pool = pool
 
487
        self.__pool = pool
488
488
 
489
489
    def cursor(self, serialized=True):
490
490
        cursor_type = serialized and 'serialized ' or ''
491
491
        _logger.debug('create %scursor to %r', cursor_type, self.dbname)
492
 
        return Cursor(self._pool, self.dbname, serialized=serialized)
 
492
        return Cursor(self.__pool, self.dbname, serialized=serialized)
493
493
 
494
494
    # serialized_cursor is deprecated - cursors are serialized by default
495
495
    serialized_cursor = cursor