SESSION.CLOSE
Closes the current session and resets all session state while keeping the connection open.
Syntax
Section titled “Syntax”SESSION.CLOSEThis command takes no parameters.
Return Value
Section titled “Return Value”Simple string: OK on success.
Behavior
Section titled “Behavior”The command performs a full session reset without closing the underlying network connection:
- Cursors: All active cursors (read, delete, update query contexts) are cleared
- FDB Transaction: Any active FoundationDB transaction is rolled back and closed
- MULTI State:
MULTItransaction state (queued commands, the MULTI flag) is reset - Watched Keys: All keys being watched via
WATCHare unwatched - Cursor ID Counter: Reset to 1
- Session Attributes: All attributes (
reply_type,input_type,limit,object_id_format) are reset to their defaults
Examples
Section titled “Examples”Basic usage:
> SESSION.CLOSEOKAfter starting a transaction:
> BEGINOK
> SESSION.CLOSEOK
> ROLLBACK(error) TRANSACTION there is no transaction in progress.The transaction is rolled back; no explicit ROLLBACK is needed.
Resetting modified session attributes:
> SESSION.ATTRIBUTE SET limit 50OK
> SESSION.CLOSEOK
> SESSION.ATTRIBUTE LIST1# reply_type => bson2# input_type => bson3# limit => (integer) 1004# object_id_format => bytesThe limit attribute is reset to its default value (100).