What's new in Valkey 9.0? Discover new features and improvements. Read the announcement.

EXEC

Executes all commands in a transaction.

Usage
EXEC
Complexity
Depends on commands in the transaction
Since
1.2.0
ACL Categories
@slow, @transaction
Command flags
NOSCRIPT, LOADING, STALE, SKIP_COMMANDLOG

Executes all previously queued commands in a transaction and restores the connection state to normal.

When using WATCH, EXEC will execute commands only if the watched keys were not modified, allowing for a check-and-set mechanism.

Replies

RESP2

One of the following:

  • Array reply: each element being the reply to each of the commands in the atomic transaction.
  • Nil reply: the transaction was aborted because a WATCHed key was touched.

RESP3

One of the following:

  • Array reply: each element being the reply to each of the commands in the atomic transaction.
  • Null reply: the transaction was aborted because a WATCHed key was touched.