Microsoft.Data.SqlClient.ConnectionPool.IDbConnectionPool
interface IDbConnectionPool
A base interface for implementing database connection pools.
Implementations are responsible for managing the lifecycle
of connections and providing access to database connections.
ConcurrentDictionary<DbConnectionPoolAuthenticationContextKey, DbConnectionPoolAuthenticationContext> AuthenticationContexts { get; }
Gets the authentication contexts cached by the pool.
Gets the factory used to create database connections.
The number of connections currently managed by the pool.
May be larger than the number of connections currently sitting idle in the pool.
Indicates whether an error has occurred in the pool.
Primarily used to support the pool blocking period feature.
An id that uniqely identifies this connection pool.
Gets the identity used by the connection pool when establishing connections.
Indicates whether the connection pool is currently running.
Gets the duration of time to wait before reassigning a connection to a different server in a load-balanced
environment.
Gets a reference to the connection pool group that this pool belongs to.
Gets the options for the connection pool group.
Gets the provider information for the connection pool.
The current state of the connection pool.
Indicates whether the connection pool is using load balancing.
void Clear()
Clears the connection pool, releasing all connections and resetting the state.
Puts an internal connection from a transacted pool back into the general pool.
DbConnectionInternal ReplaceConnection(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
Replaces the internal connection currently associated with owningObject with a new internal connection from the pool.
Returns an internal connection to the pool.
void Shutdown()
Shuts down the connection pool releasing any resources. Should be called once when the pool is no longer needed.
void Startup()
Initializes and starts the connection pool. Should be called once when the pool is created.
Informs the pool that a transaction has ended. The pool will commit and reset any internal
the transacted object associated with this transaction.
bool TryGetConnection(DbConnection owningObject, TaskCompletionSource<DbConnectionInternal> taskCompletionSource, DbConnectionOptions userOptions, out DbConnectionInternal connection)
Attempts to get a connection from the pool.