SESSION
The SET SESSION statement controls the access mode for the current session.
The SET SESSION statement must be issued before a transaction commences and the settings apply until that session is completed.
The access mode options are as follows:
READ ONLY
When a session access mode of READ ONLY is specified, insert, update, delete, copy, and DDL operations are disallowed, and an SQLSTATE of 25000 (invalid session state) is returned. Temporary tables are the exception and are always writable.
When a READ ONLY session is begun, it registers itself with the logging system and is allowed to proceed even when a ckpdb is pending against the database for the session.
READ WRITE
If READ WRITE is specified, the level of isolation can be READ UNCOMMITTED, READ COMMITTED, REPEATABLE READ, or SERIALIZABLE.
If session access mode is not specified and level of isolation is READ UNCOMMITTED, READ ONLY is implicit. Otherwise, READ WRITE is implicit.
Note: The access mode of a session has no effect on the locking mode of the session.
Last modified date: 08/14/2024