SET TRANSACTION statement

Use the SET TRANSACTION statement to define the isolation level and to specify whether the access mode of a transaction is read-only or read-write.

Syntax

(explicit id settr002) settr002 SET TRANSACTION { | [] { READ WRITE | READ ONLY } | []ISOLATION LEVEL { READ COMMITTED | REPEATABLE READ | SERIALIZABLE | READ UNCOMMITTED } }

Usage

SET TRANSACTION is valid only in databases with transaction logging. You can issue this statement from a client computer only after a database is opened. The transaction isolation level affects concurrency among processes that attempt to access the same rows simultaneously from the database. The database server uses shared locks to support different levels of isolation among processes that are attempting to read data, as the following list shows:
  • Read Uncommitted
  • Read Committed
  • (ANSI) Repeatable Read
  • Serializable

The update or delete process always acquires an exclusive lock on the row that is being modified. The level of isolation does not interfere with such rows, but the access mode does affect whether you can update or delete rows.

If another process attempts to update or delete rows that you are reading with an isolation level of Serializable or (ANSI) Repeatable Read, that process will be denied access to those rows.

1 Use path no more than once