Open saintamandc opened 13 years ago
In version 0.7 interface for working with transactions has been changed. See examples on the wiki page
RedisClient redis = session.multi(); redis.getStatusReply(RedisCommand.INCR, "boo"); session.exec();
System.out.println(session.get("boo")); session.close();
Ah, great! Thanks!
After recently updating RJC, we get the following issue:
Exception in thread "main" java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Long at org.idevlab.rjc.ds.RedisConnectionImpl.getIntegerReply(RedisConnectionImpl.java:162) at org.idevlab.rjc.ds.PoolableRedisConnection.getIntegerReply(PoolableRedisConnection.java:127) at org.idevlab.rjc.RedisClientImpl.getIntegerReply(RedisClientImpl.java:68) at org.idevlab.rjc.RedisSessionImpl.hincrBy(RedisSessionImpl.java:194) at ie.ndrc.sentinel.service.dao.inmemorydb.Dummy.doIncr(Dummy.java:22) at ie.ndrc.sentinel.service.dao.inmemorydb.Dummy.main(Dummy.java:29)
This happens when we are executing hincrBy on redis 2.2.3.
Please find the source below:
import org.idevlab.rjc.Session; import org.idevlab.rjc.SessionFactory; import org.idevlab.rjc.SessionFactoryImpl; import org.idevlab.rjc.ds.PoolableDataSource;
public class Dummy { private SessionFactory sessionFactory; private PoolableDataSource dataSource;
}