GETREADVERSION
Returns the read version of the current transaction.
Syntax
Section titled “Syntax”GETREADVERSIONThis command takes no parameters.
Return Value
Section titled “Return Value”Integer: the read version of the active transaction.
Behavior
Section titled “Behavior”Every FoundationDB transaction is assigned a read version that determines the snapshot of the database it observes. The read version is a monotonically increasing value that reflects causal ordering: a higher read version means the transaction sees a later state of the database.
This command returns the read version of the active transaction on the current session. It can be used to reason about causal ordering between transactions, coordinate across sessions, or diagnose transaction behavior.
A transaction must be started with BEGIN before calling this command.
Errors
Section titled “Errors”| Error Code | Description |
|---|---|
TRANSACTION | there is no transaction in progress.: No active transaction on the session. |
Examples
Section titled “Examples”Get the read version of an active transaction:
> BEGINOK
> GETREADVERSION(integer) 1391961467874Attempt without an active transaction:
> GETREADVERSION(error) TRANSACTION there is no transaction in progress.