Skip to main content

Transactions

Details and examples about how RESP Transactions are implemented in Garnet are found at the Developer Guide

DISCARD

Syntax

    DISCARD

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

Resp Reply

Simple string reply: OK.


EXEC

Syntax

    EXEC

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

Resp Reply

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.

MULTI

Syntax

    MULTI

Marks the start of a transaction block. Subsequent commands will be queued for atomic execution using EXEC.

Resp Reply

Simple string reply: OK.


UNWATCH

Syntax

    UNWATCH

Flushes all the previously watched keys for a transaction.

Resp Reply

Simple string reply: OK.


WATCH

Syntax

    WATCH key [key ...]

Marks the given keys to be watched for conditional execution of a transaction.

Resp Reply

Simple string reply: OK.