예제 #1
0
 /// <summary>
 /// Initializes data provider.
 /// </summary>
 /// <param name="sqlType"><see cref="SqlEngine"/> of data provider to use.</param>
 /// <param name="connectionString">Database engine connection string.</param>
 /// <param name="poolSize"><see cref="Provider"/> connections pool capacity.</param>
 /// <param name="queueDumpInterval">Interval in which cache service will execute cached commands.</param>
 internal static void Initialize( SqlEngine sqlType, string connectionString, byte poolSize, TimeSpan queueDumpInterval )
 {
     switch ( sqlType )
     {
         case SqlEngine.MsSql:
             {
                 Instance = new MsSqlDataProvider(connectionString, poolSize, queueDumpInterval);
                 Instance.OnInitialized += new ProviderInitializedEventDelegate(OnProviderInitialized);
                 Instance.OnStopped += new ProviderStoppedEventDelegate(OnProviderStopped);
                 Instance.Initialize();
                 return;
             }
         default:
             {
                 Logger.WriteLine(Source.DataProvider, "Unsupported data provider: {0}", sqlType);
                 return;
             }
     }
 }
예제 #2
0
 /// <summary>
 /// Initializes new instance of <see cref="Connection"/> object.
 /// </summary>
 /// <param name="provider">Reference to current <see cref="Connection"/> <see cref="Provider"/>.</param>
 /// <param name="connectionID">Current <see cref="Connection"/> unique id.</param>
 internal Connection( Provider provider, byte connectionID )
 {
     DBProvider = provider;
     ID = connectionID;
 }