【发布时间】:2017-03-30 17:05:19
【问题描述】:
我已经成功地在单个 REDIS 实例中使用 multi 和 exec 功能在 redis 中实现(并测试了)事务操作。但是,在集群设置中运行的相同代码会出错,并显示以下异常消息。我正在使用 spring-data-redis-1.8.1.RELEASE 和 jedis-2.9.0。
Exception in thread "main" org.springframework.dao.InvalidDataAccessApiUsageException: MUTLI is currently not supported in cluster mode.
at org.springframework.data.redis.connection.jedis.JedisClusterConnection.multi(JedisClusterConnection.java:2457)
at org.springframework.data.redis.connection.DefaultStringRedisConnection.multi(DefaultStringRedisConnection.java:608)
at org.springframework.data.redis.core.RedisTemplate$21.doInRedis(RedisTemplate.java:871)
at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:207)
at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:169)
at org.springframework.data.redis.core.RedisTemplate.multi(RedisTemplate.java:868)
at com.glu.centech.chat.RedisClusterTest$1.execute(RedisClusterTest.java:58)
at com.glu.centech.chat.RedisClusterTest$1.execute(RedisClusterTest.java:1)
at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:229)
at com.glu.centech.chat.RedisClusterTest.main(RedisClusterTest.java:55)
目前spring data redis集群模式是否支持事务(multi, exec)?如果是这样,我错过了什么?如果没有,是否有任何解决方法或何时支持?
【问题讨论】:
标签: transactions redis cluster-computing jedis spring-data-redis