Unless I'm mistaken, you should be able to set the socket timeout like this:
jedis.getClient().setTimeout(time)
this should be your first thing to try, since this is the real
exception. However, it is strnage, that you get it...
Concerning the Jedis-related timeout: in the post they must have
refered to the redis-server config file, hence this is not the same as
the timeout in JedisPool. The one in JedisPool goes to a normal Jedis,
which is a client (the Client disconnects after a time from the
server). The timeout in the config file probably defines the timeout,
when the server disconnects the client of itself. It's very easy to
edit the config file, but you can also set most of those settings in
the config file from client side, by using
configSet(EXACT_NAME_OF_PARAMETER, value).
in theory, the exception doesn't have a relation with the your code,
but sometimes exceptions don't reflect well the real problem. You
never know, maybe the above connection problem goes away when solving
other problems (maybe there is some delay that causes the socket time
out?) :
You got the transaction wrong, it should be like this:
jedis.watch(key);
Transaction t=jedis.multi();
Response<Long> resultResp=t.setnx(key, value);
t.exec();
jedis.expire(key,expiry);
Long result = resultResp.get();
Curious: what is this (for)?
JedisCacheManager.getCacheManager().returnJedis(jedis);
please consult the wiki for more details on transactions.
best
ingvar
2011/9/13 Rajitha R <rajit...@gmail.com>: