Note
This variable is available starting with in V2.2.77.
Description
transaction_read_only specifies whether to allow only read-only transactions.
Privileges requirements
Query variables
Global level
The
systenant and all user tenants can execute theSHOW VARIABLESstatement or query theSYS.TENANT_VIRTUAL_GLOBAL_VARIABLEview (in Oracle-compatible mode) or theinformation_schema.GLOBAL_VARIABLESview (in MySQL-compatible mode) to query the value of a global system variable.Session level
The
systenant and all user tenants can execute theSHOW VARIABLESstatement or query theSYS.TENANT_VIRTUAL_SESSION_VARIABLEview (in Oracle-compatible mode) or theinformation_schema.SESSION_VARIABLESview (in MySQL-compatible mode) to query the value of a session variable.
Modify variables
Global level
The
systenant can directly modify the value of a global system variable.MySQL-compatible tenants must have the
SUPERorALTER SYSTEMprivilege to modify the value of a global system variable.Oracle-compatible tenants must have the
ALTER SYSTEMprivilege to modify the value of a global system variable.
Session variables
The
systenant and all user tenants can directly modify the value of a session system variable in their respective tenant.
Attributes
| Attribute | Description |
|---|---|
| Parameter type | Bool |
| Default value | False |
| Valid values |
|
| Scope |
|
| Modifiable | Yes. You can modify this variable by using the SET statement. |
Considerations
When transaction_read_only is set to True, DML statements cannot be executed.
Examples
Configure the system variable to allow the opening of non-read-only transactions.
Session level
obclient> SET transaction_read_only = False;Global level
obclient> SET GLOBAL transaction_read_only = False;