- Type Parameters:
K- Key type.V- Value type.
- All Known Subinterfaces:
RedisClusterPubSubCommands<K,V>,RedisCommands<K,V>,RedisPubSubCommands<K,V>
public interface RedisTransactionalCommands<K,V>
Synchronous executed commands for Transactions.
- Since:
- 4.0
- Author:
- Mark Paluch
- Generated class:
- by io.lettuce.apigenerator.CreateSyncApi
-
Method Summary
Modifier and Type Method Description Stringdiscard()Discard all commands issued after MULTI.TransactionResultexec()Execute all commands issued after MULTI.Stringmulti()Mark the start of a transaction block.Stringunwatch()Forget about all watched keys.Stringwatch(K... keys)Watch the given keys to determine execution of the MULTI/EXEC block.
-
Method Details
-
discard
String discard()Discard all commands issued after MULTI.- Returns:
- String simple-string-reply always
OK.
-
exec
TransactionResult exec()Execute all commands issued after MULTI.- Returns:
- List<Object> array-reply each element being the reply to each of the commands in the atomic transaction.
When using
WATCH,EXECcan return adiscarded TransactionResult. - See Also:
TransactionResult.wasDiscarded()
-
multi
String multi()Mark the start of a transaction block.- Returns:
- String simple-string-reply always
OK.
-
watch
Watch the given keys to determine execution of the MULTI/EXEC block.- Parameters:
keys- the key.- Returns:
- String simple-string-reply always
OK.
-
unwatch
String unwatch()Forget about all watched keys.- Returns:
- String simple-string-reply always
OK.
-