Interface RedisTxCommands
- All Known Subinterfaces:
DefaultedRedisClusterConnection, DefaultedRedisConnection, RedisClusterConnection, RedisCommands, RedisConnection, RedisConnectionUtils.RedisConnectionProxy, StringRedisConnection
- All Known Implementing Classes:
AbstractRedisConnection, DefaultStringRedisConnection, JedisClusterConnection, JedisConnection, LettuceClusterConnection, LettuceConnection
@NullUnmarked
public interface RedisTxCommands
Transaction/Batch specific commands supported by Redis.
- Author:
- Costin Leau, Christoph Strobl, Mark Paluch
-
Method Summary
Modifier and TypeMethodDescriptionvoiddiscard()Discard all commands issued aftermulti().exec()Executes all queued commands in a transaction started withmulti().voidmulti()Mark the start of a transaction block.voidunwatch()Flushes all the previouslywatch(byte[]...)keys.voidwatch(byte @NonNull []... keys) Watch givenkeysfor modifications during transaction started withmulti().
-
Method Details
-
multi
-
exec
Executes all queued commands in a transaction started withmulti().
If used along withwatch(byte[]...)the operation will fail if any of watched keys has been modified.- Returns:
- List of replies for each executed command.
- See Also:
-
discard
-
watch
void watch(byte @NonNull []... keys) Watch givenkeysfor modifications during transaction started withmulti().- Parameters:
keys- must not be null.- See Also:
-
unwatch
-