public void Dispose() { if (!_released && _odbcConnection.State == ConnectionState.Open) { PooledConnections.Dispose(this); } }
public void Release() { if (!_released && _dbConnection.State == ConnectionState.Open) { PooledConnections.Release(this); } }
public void Dispose() { if (_isInUse && _odbcConnection.State == ConnectionState.Open) { PooledConnections.ReleaseConnection(this); _isInUse = false; } }
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(); } }
public void Dispose() { PooledConnections.Dispose(this); }
public void Close() { PooledConnections.ReleaseConnection(this); _isInUse = false; }