Project

General

Profile

« Previous | Next » 

Revision 2906

sql.py: DbConn: Set the transaction isolation level to READ COMMITTED using set_isolation_level() so that the isolation level affects all transactions in the session, not just the current one

View differences:

lib/sql.py
190 190
            self.__db = module.connect(**db_config)
191 191
            
192 192
            # Configure connection
193
            self.run_query('SET TRANSACTION ISOLATION LEVEL READ COMMITTED',
194
                log_level=3)
193
            if hasattr(self.db, 'set_isolation_level'):
194
                import psycopg2.extensions
195
                self.db.set_isolation_level(
196
                    psycopg2.extensions.ISOLATION_LEVEL_READ_COMMITTED)
195 197
            if schemas != None:
196 198
                search_path = [self.esc_name(s) for s in schemas.split(',')]
197 199
                search_path.append(value(run_query(self, 'SHOW search_path',

Also available in: Unified diff