摘要:
今天发现Jedis 默认的连接方式 jedis=new Jedis(‘‘localhost‘‘,6379),老是发生connection timeout. 后来发现jedis类包还有一种可以设置最大连接时间的方法。 1->获取Jedis实例需要从JedisPool中获取; 2->用完Jedis实例需要还给JedisPool; 3->如果Jedis在使用过程中出错,则也需要还给JedisPool; 代码如下 JedisPoolConfig config = new JedisPoolConfig(); config.setMaxActive(100); config.setMa 阅读全文
posted @ 2012-11-27 15:11
月小升
阅读(2879)
评论(0)
推荐(0)
浙公网安备 33010602011771号