C# Class MySql.Data.MySqlClient.MySqlPool

Summary description for MySqlPool.
Afficher le fichier Open project: elevate/mysqlconnector-.net Class Usage Examples

Private Properties

Свойство Type Description
Clear void
CreateNewPooledConnection Driver
EnqueueIdle void
GetPooledConnection Driver
RemoveOldIdleConnections List
TryToGetDriver Driver

Méthodes publiques

Méthode Description
GetConnection ( ) : Driver
MySqlPool ( MySqlConnectionStringBuilder settings ) : System
ReleaseConnection ( Driver driver ) : void
RemoveConnection ( Driver driver ) : void

Removes a connection from the in use pool. The only situations where this method would be called are when a connection that is in use gets some type of fatal exception or when the connection is being returned to the pool and it's too old to be returned.

Private Methods

Méthode Description
Clear ( ) : void

Clears this pool of all idle connections and marks this pool and being cleared so all other connections are closed when they are returned.

CreateNewPooledConnection ( ) : Driver

It is assumed that this method is only called from inside an active lock.

EnqueueIdle ( Driver driver ) : void
GetPooledConnection ( ) : Driver

It is assumed that this method is only called from inside an active lock.

RemoveOldIdleConnections ( ) : List

Remove expired drivers from the idle pool

Closing driver is a potentially lengthy operation involving network IO. Therefore we do not close expired drivers while holding idlePool.SyncRoot lock. We just remove the old drivers from the idle queue and return them to the caller. The caller will need to close them (or let GC close them)

TryToGetDriver ( ) : Driver

Method Details

GetConnection() public méthode

public GetConnection ( ) : Driver
Résultat Driver

MySqlPool() public méthode

public MySqlPool ( MySqlConnectionStringBuilder settings ) : System
settings MySqlConnectionStringBuilder
Résultat System

ReleaseConnection() public méthode

public ReleaseConnection ( Driver driver ) : void
driver Driver
Résultat void

RemoveConnection() public méthode

Removes a connection from the in use pool. The only situations where this method would be called are when a connection that is in use gets some type of fatal exception or when the connection is being returned to the pool and it's too old to be returned.
public RemoveConnection ( Driver driver ) : void
driver Driver
Résultat void