I'm using latest Spring Data Redis (1.0.1.RELEASE) on Tomcat 7. In addition, I'm using the Jedis connector, along with use-pool set to 'true'. My spring config stuff is defined in a standard way as per documentation.
My issue is that I'm getting sporadic ClassCastExceptions, e.g:
java.lang.ClassCastException: [B cannot be cast to java.util.List
From reading Jedis newsgroup, it looks like those can occur if a 'dirty' Jedis instance is released back into the pool (usually during broken pipeline operations). I'm using Spring Data Redis as follows:
java.lang.ClassCastException: java.util.ArrayList cannot be cast to java.lang.Long
It looks like, RedisConnectionUtils.releaseConnection may not in fact, clean up, broken jedis instance - in which case, is there a proper way to disposing of jedis instances? I understand this isn't quite the standard way of using RedisTemplate wrapper.
RedisConnectionFactory factory = template.getConnectionFactory();
RedisConnection conn = factory.getConnection();
Jedis jedis = (Jedis)conn.getNativeConnection();
Pipeline p = jedis.pipelined();
//More jedis stuff goes here