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 = jedis.get(key);

System.out.println(i+"--" + data);
jedis.close();
// jedisPool.returnBrokenResource(jedis);
}
 
 
目测 close 性能要比 returnBrokenResource 高
文章来自:http://www.cnblogs.com/zbw911/p/6206327.html
© 2021 jiaocheng.bubufx.com  联系我们
ICP备案:鲁ICP备09046678号-3