protected DbConnectionFactory(DbConnectionPoolCounters performanceCounters) { _performanceCounters = performanceCounters; _connectionPoolGroups = new Dictionary <DbConnectionPoolKey, DbConnectionPoolGroup>(); _poolsToRelease = new List <DbConnectionPool>(); _poolGroupsToRelease = new List <DbConnectionPoolGroup>(); _pruningTimer = CreatePruningTimer(); }
internal void MakeNonPooledObject(object owningObject, DbConnectionPoolCounters performanceCounters) { // Used by DbConnectionFactory to indicate that this object IS NOT part of // a connection pool. _connectionPool = null; _performanceCounters = performanceCounters; _owningObject.Target = owningObject; _pooledCount = -1; }
internal void MakePooledConnection(DbConnectionPool connectionPool) { // Used by DbConnectionFactory to indicate that this object IS part of // a connection pool. // TODO: consider using ADP.TimerCurrent() for this. _createTime = DateTime.UtcNow; // WebData 111116 _connectionPool = connectionPool; _performanceCounters = connectionPool.PerformanceCounters; }
public virtual void Dispose() { _connectionPool = null; _performanceCounters = null; _connectionIsDoomed = true; _enlistedTransactionOriginal = null; // should not be disposed // Dispose of the _enlistedTransaction since it is a clone // of the original reference. // VSDD 780271 - _enlistedTransaction can be changed by another thread (TX end event) SysTx.Transaction enlistedTransaction = Interlocked.Exchange(ref _enlistedTransaction, null); if (enlistedTransaction != null) { enlistedTransaction.Dispose(); } }