Jedis connection is not closed by the jedis.close() method -
i using redis storing data. when issue jedis.close()
server, connection not closed, still showing in list of connections (e.g. client list
command in redis still shows jedis connection). if server shutdown, connection ends in redis.
why doesn't jedis.close()
method close connection? can explain behaviour?
i attached code snippet:
try { genericobjectpoolconfig poolconfig = new genericobjectpoolconfig(); poolconfig.setmaxtotal(max_active_pool); poolconfig.setmaxidle(max_idle); poolconfig.setminidle(min_idle); pool = new jedispool(poolconfig, single_redis_ip, single_redis_ip_port, timeout, redis_password,redis_rdb_number); jedis jedis = pool.getresource(); jedis.clientsetname("testredis"); system.out.println(jedis.smembers("apikey")); system.out.println(jedis.get("apikey")); if(jedis != null && jedis.isconnected()) jedis.close(); } catch(exception e) { e.printstacktrace(); }
Comments
Post a Comment