Example usage for org.springframework.data.redis.connection RedisConnection discard

List of usage examples for org.springframework.data.redis.connection RedisConnection discard

Introduction

In this page you can find the example usage for org.springframework.data.redis.connection RedisConnection discard.

Prototype

void discard();

Source Link

Document

Discard all commands issued after #multi() .

Usage

From source file:com.zxy.commons.cache.RedisUtils.java

/**
 * Discard all commands issued after {@link #multi()}.
 * <p>/*from  w  ww. ja va 2s .c o  m*/
 * See http://redis.io/commands/discard
 */
public static void discard() {
    redisTemplate.execute(new RedisCallback<Void>() {
        @Override
        public Void doInRedis(RedisConnection redis) throws DataAccessException {
            redis.discard();
            return null;
        }
    });
}

From source file:com.zxy.commons.cache.RedisHelper.java

/**
 * Discard all commands issued after {@link #multi()}.
 * <p>//from  www  .  jav  a 2  s .co m
 * See http://redis.io/commands/discard
 */
public void discard() {
    redisTemplate.execute(new RedisCallback<Void>() {
        @Override
        public Void doInRedis(RedisConnection redis) throws DataAccessException {
            redis.discard();
            return null;
        }
    });
}