Read timed out exception in watch

52 views
Skip to first unread message

Rajitha R

unread,
Sep 13, 2011, 6:17:07 AM9/13/11
to Jedis
Hi All,

I have been using jedis to insert key-value pairs into the db as
follows:

jedis.watch(key);
Long result=jedis.setnx(key, value);
jedis.expire(key,expiry);
Transaction t=jedis.multi();
list=t.exec();
JedisCacheManager.getCacheManager().returnJedis(jedis);

I am getting an exception ( in lines 1 and 2 of above code ) as
follows:

java.lang.ClassCastException
redis.clients.jedis.exceptions.JedisConnectionException:
java.net.SocketTimeoutException: Read timed out
at redis.clients.jedis.Protocol.process(Protocol.java:74)
at redis.clients.jedis.Protocol.read(Protocol.java:122)
at redis.clients.jedis.Connection.getIntegerReply(Connection.java:
178)
at redis.clients.jedis.Jedis.expire(Jedis.java:272)

I have gone through some of the recent posts where it is told to
increase the timeout in conf file.I have set timeout in redis.conf as
1800. But none of my clients are idle to get timed out. I also set the
timeout in Jedispool constructor to 21600.

I am facing this error when i insert very large number of key-value
pairs into the database and not otherwise.Why is it that i am facing
it in the watch and setnx calls?

Kindly help.

Thanks,
Rajitha
Reply all
Reply to author
Forward
0 new messages