title: How to change redis DB that the redis client is from redis pool
body: <p>How can I changedb(redis command select), when I used the pool of redis.</p>
  
  <p>I want write host and read host from different DB.</p>
  
  <p>for example:</p>
  
  <p><strong>just now I only have one redis server,so the readWriteHosts = readOnlyHosts</strong></p>
  
  <pre><code> pool = RedisDao.CreateManager(hostIp, hostIp);
  
   public static PooledRedisClientManager CreateManager(string[] readWriteHosts, string[] readOnlyHosts)
      {
          return new PooledRedisClientManager(readWriteHosts, readOnlyHosts, new RedisClientManagerConfig
          {
              MaxWritePoolSize = 50,//
              MaxReadPoolSize = 5,//
              AutoStart = true,
          });
      }
  
      public RedisDB ReadRedisForModel(String ID)
      {
  </code></pre>
  
  <p><strong>//here I want to use DB number is day%15</strong></p>
  
  <pre><code>        using (var redis = pool.GetClient())
          {
              RedisDB model = new RedisDB();
              Dictionary&lt;string, string&gt; dic = redis.GetAllEntriesFromHash(keyPrefix + ID);
              model.ID = ID;//Int32.Parse(ids[i]);           
              return model;
          }           
      }
  
      public void WriteRedis(RedisDB model)
      {
  </code></pre>
  
  <p><strong>//here I want to use DB number is (day-1)%15</strong></p>
  
  <pre><code>            using (var redis = pool.GetClient())
              {
  </code></pre>
  
  <p><strong>EDIT:</strong></p>
  
  <p>I find a  way to set different  DB,But I feel this solution is not best way. </p>
  
  <pre><code>                if(redis is RedisClient)
                  {
                          long db =  redis.DB;//db always = 0;
                         ((RedisClient)redis).ChangeDB((day-1)%15);
                  }
  </code></pre>
  
  <p>Is it need to lock thread? when i am read or write to redis.
  I am afraid, I got the same redis client in mutil-thread . then the redis DB is ?</p>
  
  <p><strong>Edit end</strong></p>
  
  <pre><code>                int time = DateTimeUtil.ConvertDateTimeInt(DateTime.Now);
                  model.ID = time + redis.Increment(incrementKey, 1) + "";//.Incr("ID");                
                  using (var pip = redis.CreatePipeline())
                  {
                      pip.QueueCommand(r =&gt; r.AddItemToList(primaryKey, model.ID + ""));
                      pip.Flush();
                  };
  
              };                         
      }
  </code></pre>
  
  <p>I got redisClient from pool, but redisClient is not have the function of changeDB.</p>
  
  <p>So anybody kowns how to set it?</p>