Increment the number of executions for the current connection.

        :param psycopg2.extensions.connection conn: the psycopg2 connection
3131
def _incr_executions(self, conn):
        
        self._pool_manager.get_connection(self.pid, conn).executions += 1
949676
protected void incrementActiveConns() {
        int count = this.activeConnections.incrementAndGet();
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "Increment active, current=" + count);
        }
    }
431599
def _connect(self):
        
        future = concurrent.Future()

        # Attempt to get a cached connection from the connection pool
        try:
            connection = self._pool_manager.get(self.pid, self)
            self._connections[connection.fileno()] = connection
            future.set_result(connection)

            # Add the connection to the IOLoop
            self._ioloop.add_handler(connection.fileno(),
                                     self._on_io_events,
                                     ioloop.IOLoop.WRITE)
        except pool.NoIdleConnectionsError:
            self._create_connection(future)

        return future
773130
def Connect(self):
		
		if self.connection is None:
			self.connection = MySQLdb.connect(*[], **self.connectionInfo.info)
			
		if self.connectionInfo.commitOnEnd is True:
			self.connection.autocommit()
			
		self._updateCheckTime()
810767
def run_query_series(queries, conn):
    
    results = []
    for item in queries:
        qry = item
        kwargs = {}
        if isinstance(item, tuple):
            qry = item[0]
            kwargs = item[1]
        result = conn.update_query(qry, **kwargs)
        # pdb.set_trace()
        results.append(result)
    return results
992731
def add(cls, pid, connection):
        
        with cls._lock:
            cls._ensure_pool_exists(pid)
            cls._pools[pid].add(connection)
767176
def add_connections(self, conns):
        
        rets = []
        for addr, kwargs in conns:
            r = self.add_connection(addr, **kwargs)
            rets.append(r)
        return rets
572775
def add_column(connection, column):
    
    stmt = alembic.ddl.base.AddColumn(_State.table.name, column)
    connection.execute(stmt)
    _State.reflect_metadata()
754342
def execute(self, operation, params=()):
        
        conn = self._assert_open()
        conn._try_activate_cursor(self)
        self._execute(operation, params)
        # for compatibility with pyodbc
        return self
660286
def execute(self, sql, params=None):
        
        # wrap in a transaction to ensure things are committed
        # https://github.com/smnorris/pgdata/issues/3
        with self.engine.begin() as conn:
            result = conn.execute(sql, params)
        return result
74434
def connection_count(self):
        
        return self.sql("SELECT value FROM %(master)s WHERE name = 'connection_counter'" % vars(self),
                        cache=False, asrecarray=False)[0][0]
99151
def _conn(commit=False):
    '''
    
    '''
    defaults = {'host': 'localhost',
                'user': 'salt',
                'password': 'salt',
                'dbname': 'salt',
                'port': 5432}

    conn_kwargs = {}
    for key, value in defaults.items():
        conn_kwargs[key] = __opts__.get('queue.{0}.{1}'.format(__virtualname__, key), value)
    try:
        conn = psycopg2.connect(**conn_kwargs)
    except psycopg2.OperationalError as exc:
        raise SaltMasterError('pgjsonb returner could not connect to database: {exc}'.format(exc=exc))

    cursor = conn.cursor()

    try:
        yield cursor
    except psycopg2.DatabaseError as err:
        error = err.args
        sys.stderr.write(six.text_type(error))
        cursor.execute("ROLLBACK")
        raise err
    else:
        if commit:
            cursor.execute("COMMIT")
        else:
            cursor.execute("ROLLBACK")
    finally:
        conn.close()
413849
async def connect_async(self, loop=None, timeout=None):
        
        if self.deferred:
            raise Exception("Error, database not properly initialized "
                            "before opening connection")

        if self._async_conn:
            return
        elif self._async_wait:
            await self._async_wait
        else:
            self._loop = loop
            self._async_wait = asyncio.Future(loop=self._loop)

            conn = self._async_conn_cls(
                database=self.database,
                loop=self._loop,
                timeout=timeout,
                **self.connect_params_async)

            try:
                await conn.connect()
            except Exception as e:
                if not self._async_wait.done():
                    self._async_wait.set_exception(e)
                self._async_wait = None
                raise
            else:
                self._task_data = TaskLocals(loop=self._loop)
                self._async_conn = conn
                self._async_wait.set_result(True)
590623
protected void updateCreatedConnections(int increment) {

		try {
			this.statsLock.writeLock().lock();
			this.createdConnections += increment;
		} finally {
			this.statsLock.writeLock().unlock();
		}
	}
730448
def execute(self, conn,  origin_site_name="", dataset="", block_name="", transaction = False):
        
        if not conn:
            dbsExceptionHandler("dbsException-db-conn-failed",
                                "Oracle/Block/List.  Expects db connection from upper layer.", self.logger.exception)
        binds = {}
        if origin_site_name:
            wheresql = 'WHERE B.ORIGIN_SITE_NAME = :origin_site_name'
            binds.update(origin_site_name=origin_site_name)

        if dataset:
            if 'wheresql' in locals():
                wheresql += ' AND DS.DATASET = :dataset'
            else:
                wheresql = 'WHERE DS.DATASET = :dataset'
            binds.update(dataset=dataset)

        if block_name:
            if 'wheresql' in locals():
                wheresql += ' AND B.BLOCK_NAME = :block_name'
            else:
                wheresql = 'WHERE B.BLOCK_NAME = :block_name'
            binds.update(block_name=block_name)

        sql = '{sql} {wheresql}'.format(sql=self.sql, wheresql=wheresql)

        cursors = self.dbi.processData(sql, binds, conn, transaction, returnCursor=True)
        result = []
        for cursor in cursors:
            result.extend(self.formatCursor(cursor, size=100))
        return result
307064
private void addConnection() throws SQLException {

    //create new connection
    Protocol protocol = Utils.retrieveProxy(urlParser, globalInfo);
    MariaDbConnection connection = new MariaDbConnection(protocol);
    MariaDbPooledConnection pooledConnection = createPoolConnection(connection);

    if (options.staticGlobal) {
      //on first connection load initial state
      if (globalInfo == null) {
        initializePoolGlobalState(connection);
      }
      //set default transaction isolation level to permit resetting to initial state
      connection.setDefaultTransactionIsolation(globalInfo.getDefaultTransactionIsolation());
    } else {
      //set default transaction isolation level to permit resetting to initial state
      connection.setDefaultTransactionIsolation(connection.getTransactionIsolation());
    }

    if (poolState.get() == POOL_STATE_OK
        && totalConnection.incrementAndGet() <= options.maxPoolSize) {
      idleConnections.addFirst(pooledConnection);

      if (logger.isDebugEnabled()) {
        logger.debug("pool {} new physical connection created (total:{}, active:{}, pending:{})",
            poolTag, totalConnection.get(), getActiveConnections(), pendingRequestNumber.get());
      }
      return;
    }

    silentCloseConnection(pooledConnection);
  }
810519
def increment(self, conn, seqName, transaction = False, incCount=1):
        
	try:
	    seqTable = "%sS" %seqName
	    tlock = "lock tables %s write" %seqTable
	    self.dbi.processData(tlock, [], conn, transaction)
	    sql = "select ID from %s" % seqTable
	    result = self.dbi.processData(sql, [], conn, transaction)
	    resultlist = self.formatDict(result)
	    newSeq = resultlist[0]['id']+incCount
	    sql = "UPDATE %s SET ID=:seq_count" % seqTable
	    seqparms={"seq_count" : newSeq}
	    self.dbi.processData(sql, seqparms, conn, transaction)
	    tunlock = "unlock tables"
	    self.dbi.processData(tunlock, [], conn, transaction)
	    return newSeq
	except:
	    #FIXME
	    tunlock = "unlock tables"
	    self.dbi.processData(tunlock, [], conn, transaction)
	    raise