コード例 #1
0
 public void Dispose()
 {
     if (!_released && _odbcConnection.State == ConnectionState.Open)
     {
         PooledConnections.Dispose(this);
     }
 }
コード例 #2
0
 public void Release()
 {
     if (!_released && _dbConnection.State == ConnectionState.Open)
     {
         PooledConnections.Release(this);
     }
 }
コード例 #3
0
 public void Dispose()
 {
     if (_isInUse && _odbcConnection.State == ConnectionState.Open)
     {
         PooledConnections.ReleaseConnection(this);
         _isInUse = false;
     }
 }
コード例 #4
0
        public async Task OpenAsync()
        {
#if ADO
            _dbConnection = new Npgsql.NpgsqlConnection(_connectionString);
#else
            if (_dbConnection is null)
            {
                using var internalConnection = await PooledConnections.GetConnection(_connectionString);

                _dbConnection   = internalConnection.DbConnection;
                _number         = internalConnection.Number;
                _pooledCommands = internalConnection.PooledCommands;
            }
#endif

            if (_dbConnection.State == ConnectionState.Closed)
            {
                await(_dbConnection as System.Data.Common.DbConnection).OpenAsync();
            }
        }
コード例 #5
0
 public void Dispose()
 {
     PooledConnections.Dispose(this);
 }
コード例 #6
0
 public void Close()
 {
     PooledConnections.ReleaseConnection(this);
     _isInUse = false;
 }