SET TRANSACTION
Function
SET TRANSACTION sets the characteristics of the current transaction. It has no effect on any subsequent transactions. Available transaction characteristics include the transaction separation level and transaction access mode (read/write or read only).
Precautions
None
Syntax
1 2 3 |
{ SET [ LOCAL ] TRANSACTION|SET SESSION CHARACTERISTICS AS TRANSACTION } { ISOLATION LEVEL { READ COMMITTED | READ UNCOMMITTED | SERIALIZABLE | REPEATABLE READ } | { READ WRITE | READ ONLY } } [, ...] |
Parameter Description
Parameter |
Description |
Value Range |
---|---|---|
LOCAL |
Indicates that the specified command takes effect only for the current transaction. |
- |
SESSION |
Indicates that the specified command takes effect only for the current session. |
A string, which must comply with the naming convention. |
ISOLATION LEVEL |
Specifies the transaction isolation level that determines the data that a transaction can view if other concurrent transactions exist.
NOTE:
The isolation level of a transaction cannot be reset after the first clause (INSERT, DELETE, UPDATE, FETCH, COPY) for modifying data is executed in the transaction. |
|
READ WRITE | READ ONLY |
Specifies the transaction access mode. |
Read-write mode or read-only mode. |
Examples
Set the isolation level of the current transaction to READ COMMITTED and the access mode to READ ONLY:
1 2 3 |
START TRANSACTION; SET LOCAL TRANSACTION ISOLATION LEVEL READ COMMITTED READ ONLY; COMMIT; |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot