Skip to content

TRANSACTION LIST

Returns the open transactions of this member.

TRANSACTION LIST

LIST takes no arguments.

An array with one map per open transaction, sorted by id. On RESP2 each map is a flat array of keys and values.

FieldTypeDescription
idintegerTransaction id, unique on this member
duration_msintegerMilliseconds since the transaction was created
idle_msintegerMilliseconds since the last command on the transaction finished, 0 while a command runs
client_idintegerClient id of the session that owns the transaction, -1 for the member’s own
statestringactive while a command runs, idle between two commands of a BEGIN block
namespacestring or nullNamespace of the command
bucketstring or nullBucket of the command, null when the command has no bucket
modelstring or nullData model of the command: Bucket or ZMap, null for others
commandstring or nullName of the command
querystring or nullBQL query of the command, every value replaced by ?
watchingbooleanTrue when the transaction holds a watch
readsintegerPoint reads
range_readsintegerRange reads
writesintegerWrites
deletesintegerDeletes
range_deletesintegerRange deletes
mutationsintegerAtomic mutations
bytes_readintegerBytes read
bytes_writtenintegerBytes written

The list shows only the member that runs the command, not the whole cluster.

Each transaction shows the command that opened it. A transaction opened with BEGIN shows the last command that used it. BEGIN, COMMIT and ROLLBACK are not shown as commands. Some commands, like TICK or NAMESPACE.LIST, open their own transaction. Such a transaction is listed on its own, with the client_id of the session that sent the command.

The member also opens transactions for its own work. These have client_id set to -1 and no command, so namespace, bucket, model, command and query are null.

Command arguments and keys are not stored. query shows only the structure of the query, with every value replaced by ?.

A closed transaction is no longer listed. Slow transactions that have closed are shown by TRANSACTION SLOW.

Another session ran a query in a BEGIN block and has not committed yet:

> TRANSACTION LIST
1) 1# "id" => (integer) 42
2# "duration_ms" => (integer) 1203
3# "idle_ms" => (integer) 980
4# "client_id" => (integer) 7
5# "state" => "idle"
6# "namespace" => "global"
7# "bucket" => "users"
8# "model" => "Bucket"
9# "command" => "BUCKET.QUERY"
10# "query" => "{\"age\": {\"$gt\": ?}}"
11# "watching" => (false)
12# "reads" => (integer) 3
13# "range_reads" => (integer) 1
14# "writes" => (integer) 0
15# "deletes" => (integer) 0
16# "range_deletes" => (integer) 0
17# "mutations" => (integer) 0
18# "bytes_read" => (integer) 512
19# "bytes_written" => (integer) 0