https://www.cnblogs.com/zxf330301/p/6889202.html
- SessionCallback<Object> sessionCallback=new SessionCallback<Object>(){
- @Override
- public Object execute(RedisOperations operations) throws DataAccessException{
- operations.multi();
- operations.delete("test");
- operations.opsForValue.set("test","2");
- Object val=operations.exec();
- return val;
- }
- }
- StringRedisTemplate.execute(sessionCallback);