org.springframework.data.redis.connection
Interface RedisTxCommands

All Known Subinterfaces:
RedisCommands, RedisConnection, StringRedisConnection
All Known Implementing Classes:
DefaultStringRedisConnection, JedisConnection, JredisConnection, LettuceConnection, SrpConnection

public interface RedisTxCommands

Transaction/Batch specific commands supported by Redis.


Method Summary
 void discard()
          Discard all commands issued after multi().
 List<Object> exec()
          Executes all queued commands in a transaction started with multi().
 void multi()
          Mark the start of a transaction block.
 void unwatch()
          Flushes all the previously #watch(byte[]) keys.
 void watch(byte[]... keys)
          Watch given keys for modifications during transaction started with multi().
 

Method Detail

multi

void multi()
Mark the start of a transaction block.
Commands will be queued and can then be executed by calling exec() or rolled back using discard() .

See Also:
http://redis.io/commands/multi

exec

List<Object> exec()
Executes all queued commands in a transaction started with multi().
If used along with #watch(byte[]) the operation will fail if any of watched keys has been modified.

Returns:
List of replies for each executed command.
See Also:
http://redis.io/commands/exec

discard

void discard()
Discard all commands issued after multi().

See Also:
http://redis.io/commands/discard

watch

void watch(byte[]... keys)
Watch given keys for modifications during transaction started with multi().

Parameters:
keys -
See Also:
http://redis.io/commands/watch

unwatch

void unwatch()
Flushes all the previously #watch(byte[]) keys.

See Also:
http://redis.io/commands/unwatch