internal DbConnectionPoolGroup(System.Data.Common.DbConnectionOptions connectionOptions, System.Data.ProviderBase.DbConnectionPoolGroupOptions poolGroupOptions)
 {
     this._connectionOptions = connectionOptions;
     this._poolGroupOptions = poolGroupOptions;
     this._poolCollection = new HybridDictionary(1, false);
     this._state = 1;
 }
示例#2
0
 internal DbConnectionPoolGroup(System.Data.Common.DbConnectionOptions connectionOptions, System.Data.ProviderBase.DbConnectionPoolGroupOptions poolGroupOptions)
 {
     this._connectionOptions = connectionOptions;
     this._poolGroupOptions  = poolGroupOptions;
     this._poolCollection    = new HybridDictionary(1, false);
     this._state             = 1;
 }
 private System.Data.ProviderBase.DbConnectionPool GetConnectionPool(DbConnection owningObject, System.Data.ProviderBase.DbConnectionPoolGroup connectionPoolGroup)
 {
     if (connectionPoolGroup.IsDisabled && (connectionPoolGroup.PoolGroupOptions != null))
     {
         Bid.Trace("<prov.DbConnectionFactory.GetConnectionPool|RES|INFO|CPOOL> %d#, DisabledPoolGroup=%d#\n", this.ObjectID, connectionPoolGroup.ObjectID);
         System.Data.ProviderBase.DbConnectionPoolGroupOptions poolGroupOptions = connectionPoolGroup.PoolGroupOptions;
         System.Data.Common.DbConnectionOptions connectionOptions = connectionPoolGroup.ConnectionOptions;
         string connectionString = connectionOptions.UsersConnectionString(false);
         connectionPoolGroup = this.GetConnectionPoolGroup(connectionString, poolGroupOptions, ref connectionOptions);
         this.SetConnectionPoolGroup(owningObject, connectionPoolGroup);
     }
     return(connectionPoolGroup.GetConnectionPool(this));
 }
 internal System.Data.ProviderBase.DbConnectionPoolGroup GetConnectionPoolGroup(string connectionString, System.Data.ProviderBase.DbConnectionPoolGroupOptions poolOptions, ref System.Data.Common.DbConnectionOptions userConnectionOptions)
 {
     System.Data.ProviderBase.DbConnectionPoolGroup group;
     if (System.Data.Common.ADP.IsEmpty(connectionString))
     {
         return(null);
     }
     if (!this._connectionPoolGroups.TryGetValue(connectionString, out group) || (group.IsDisabled && (group.PoolGroupOptions != null)))
     {
         System.Data.Common.DbConnectionOptions options = this.CreateConnectionOptions(connectionString, userConnectionOptions);
         if (options == null)
         {
             throw System.Data.Common.ADP.InternalConnectionError(System.Data.Common.ADP.ConnectionError.ConnectionOptionsMissing);
         }
         string str = connectionString;
         if (userConnectionOptions == null)
         {
             userConnectionOptions = options;
             str = options.Expand();
             if (str != connectionString)
             {
                 return(this.GetConnectionPoolGroup(str, null, ref userConnectionOptions));
             }
         }
         if ((poolOptions == null) && System.Data.Common.ADP.IsWindowsNT)
         {
             if (group != null)
             {
                 poolOptions = group.PoolGroupOptions;
             }
             else
             {
                 poolOptions = this.CreateConnectionPoolGroupOptions(options);
             }
         }
         System.Data.ProviderBase.DbConnectionPoolGroup group2 = new System.Data.ProviderBase.DbConnectionPoolGroup(options, poolOptions)
         {
             ProviderInfo = this.CreateConnectionPoolGroupProviderInfo(options)
         };
         lock (this)
         {
             Dictionary <string, System.Data.ProviderBase.DbConnectionPoolGroup> dictionary = this._connectionPoolGroups;
             if (!dictionary.TryGetValue(str, out group))
             {
                 Dictionary <string, System.Data.ProviderBase.DbConnectionPoolGroup> dictionary2 = new Dictionary <string, System.Data.ProviderBase.DbConnectionPoolGroup>(1 + dictionary.Count);
                 foreach (KeyValuePair <string, System.Data.ProviderBase.DbConnectionPoolGroup> pair in dictionary)
                 {
                     dictionary2.Add(pair.Key, pair.Value);
                 }
                 dictionary2.Add(str, group2);
                 this.PerformanceCounters.NumberOfActiveConnectionPoolGroups.Increment();
                 group = group2;
                 this._connectionPoolGroups = dictionary2;
             }
             return(group);
         }
     }
     if (userConnectionOptions == null)
     {
         userConnectionOptions = group.ConnectionOptions;
     }
     return(group);
 }