正確にいつこのメソッドを使用する必要があるか。JedisConnectionException、JedisDataException、または任意の JedisException の場合。私の知る限り、Jedis に関する適切な API ドキュメントはありません。
try {
Jedis jedis = JedisFactory.getInstance();
Pipeline pipe = jedis.pipelined();
Response<Set<Tuple>> idWithScore = pipe.zrangeWithScores(cachekey, from, to);
**// some statement which may cause some other exception**
Response<String> val = pipe.get(somekey);
pipe.exec();
pipe.sync();
}catch (JedisConnectionException e) {
JedisFactory.returnBrokenResource(jedis);
}catch(Exception e){
**// What API I should use here?, how to find whether to use returnBrokenResource(jedis) or returnResource(jedis)**
}finally{
JedisFactory.returnResource(jedis);
}