예제 #1
0
        public RawDb(ConcurrentRandom random, DbProviderFactory dbProviderFactory)
        {
            _random            = random;
            _dbProviderFactory = dbProviderFactory;
            _connectionString  = "Server=tfb-database;Database=hello_world;User Id=benchmarkdbuser;Password=benchmarkdbpass;Maximum Pool Size=256;NoResetOnClose=true;Enlist=false;Max Auto Prepare=3";
            //_connectionString = "Server=192.168.2.19;Database=hello_world;User Id=benchmarkdbuser;Password=benchmarkdbpass;Maximum Pool Size=256;NoResetOnClose=true;Enlist=false;Max Auto Prepare=3";


            for (int i = 0; i < 256; i++)
            {
                DbConnection conn = dbProviderFactory.CreateConnection();
                conn.ConnectionString = _connectionString;
                RawDbConnection rawDbConnection = new RawDbConnection(conn, this);
                mPool.Push(rawDbConnection);
            }
        }
예제 #2
0
 private void Push(RawDbConnection conn)
 {
     mPool.Push(conn);
 }
예제 #3
0
 public void Close()
 {
     RawDbConnection.Dispose();
     DbConnection.Dispose();
 }