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

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

Introduction

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

Prototype

void save();

Source Link

Document

Synchronous save current db snapshot on server.

Usage

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

/**
 * Synchronous save current db snapshot on server.
 * <p>//from  w  w  w .ja  v  a 2  s . c  o m
 * See http://redis.io/commands/save
 */
public static void save() {
    redisTemplate.execute(new RedisCallback<Void>() {
        @Override
        public Void doInRedis(RedisConnection redis) throws DataAccessException {
            redis.save();
            return null;
        }
    });
}

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

/**
 * Synchronous save current db snapshot on server.
 * <p>//from  w  w  w .  j av a2  s  .  com
 * See http://redis.io/commands/save
 */
public void save() {
    redisTemplate.execute(new RedisCallback<Void>() {
        @Override
        public Void doInRedis(RedisConnection redis) throws DataAccessException {
            redis.save();
            return null;
        }
    });
}