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); } }
private void Push(RawDbConnection conn) { mPool.Push(conn); }
public void Close() { RawDbConnection.Dispose(); DbConnection.Dispose(); }