首页 > 代码库 > jedisPool.returnBrokenResource 弃用

jedisPool.returnBrokenResource 弃用

 

       for (int i = 0; i < 1000000 ; i++) {
//使用Pool的方式 调用Redis
JedisPool jedisPool = SpringContextHolder.getBean(JedisPool.class);
Jedis jedis = jedisPool.getResource();
String key = "testKey";
jedis.set(key,"fasdfasdfasdfasdfasdf");

String data = http://www.mamicode.com/jedis.get(key);

System.out.println(i+"--" + data);
jedis.close();
// jedisPool.returnBrokenResource(jedis);
}
 
 
目测 close 性能要比 returnBrokenResource 高

jedisPool.returnBrokenResource 弃用