【发布时间】:2015-03-02 10:30:25
【问题描述】:
我必须按需为每个请求(写入/读取)创建 RedisTemplate。 连接工厂是 JedisConnectionFactory
JedisConnectionFactory factory=new
JedisConnectionFactory(RedisSentinelConfiguration,JedisPoolConfig);
有一次,我用RedisTemplate.opsForHash/opsForValue做操作,如何安全的dispose模板,让连接返回到JedisPool。
到目前为止,我用
template.getConnectionFactory().getConnection().close();
这是正确的方法吗?
【问题讨论】:
标签: redis jedis spring-data-redis