SET TRANSACTION
Name
SET TRANSACTION -- set the characteristics of the current transaction
Summary
SET TRANSACTION transaction_mode
Transaction_mode is one of the following five options
ISOLATION LEVEL { SERIALIZABLE | READ COMMITTED }
READ WRITE | READ ONLY
Description
SET TRANSACTION sets the characteristics of the current transaction and has no effect on subsequent transactions. The allowed transaction processing characteristics are transaction isolation level and transaction access mode (read/write or read-only). When other transactions are running concurrently, the transaction isolation level determines the data that the transaction can see.
READ COMMITTED
statement can only see the records that were committed before this statement was run. This is the default setting.
SERIALIZABLE
Until the first query or data modification statement is executed in a transaction, all statements in the current transaction can only see the committed rows.
The transaction isolation level cannot be changed after the first query or data modification statement (including SELECT, INSERT, DELETE, UPDATE, or FETCH) in the transaction has run.
The transaction access mode determines whether the transaction is in read/write mode or read-only mode. Read/write mode is the default condition. When the transaction is in read-only mode, the following SQL commands are not allowed: INSERT, UPDATE, and DELETE commands if they are writing to a non-temporary table; all CREATE, ALTER, and DROP commands. COMMENT, GRANT, REVOKE, TRUNCATE; and if the commands executed include those listed above, the EXECUTE command is also included. This is a high-level concept about read-only that does not prevent all write operations to disk.
Top comments (0)