SQL/MX 2.x Reference Manual (H06.04+)

Introduction
HP NonStop SQL/MX Reference Manual540440-003
1-21
Transaction Access Modes
Transaction Access Modes
A transaction has an access mode that is either READ ONLY or READ WRITE. You
can set the access mode of a transaction by using a SET TRANSACTION statement.
See SET TRANSACTION Statement on page 2-218.
READ ONLY
If a transaction is executing with the READ ONLY access mode, statements within the
transaction can read, but cannot insert, delete, or update, data in tables. This
restriction means that among the DML statements, only the SELECT statement can
execute within that transaction.
If the transaction isolation level is READ UNCOMMITTED, the default access mode is
READ ONLY. Further, for READ UNCOMMITTED, you can specify only READ ONLY
explicitly by using the SET TRANSACTION statement.
READ WRITE
If a transaction is executing with the READ WRITE access mode, statements within the
transaction can read, insert, delete, or update data in tables. Therefore, any DML
statement can execute within that transaction.
If the transaction isolation level is not READ UNCOMMITTED, the default access
mode is READ WRITE. However, you can specify READ ONLY explicitly by using the
SET TRANSACTION statement.
Transaction Isolation Levels
A transaction has an isolation level that is either READ UNCOMMITTED, READ
COMMITTED, or SERIALIZABLE or REPEATABLE READ. The SQL/MX
implementation for REPEATABLE READ and SERIALIZABLE is equivalent.
SERIALIZABLE is used for purposes of illustration.
You can set the isolation level of a transaction explicitly by using a SET
TRANSACTION statement. See SET TRANSACTION Statement on page 2-218.
You can set your system default for the transaction isolation level by specifying the
ISOLATION_LEVEL entry in the SYSTEM_DEFAULTS table. The default isolation level
of a transaction is determined according to the rules specified in ISOLATION_LEVEL
on page 10-45.
READ UNCOMMITTED
This isolation level allows your transaction to access locked data. You cannot use
READ UNCOMMITTED for transactions that modify the database.
READ UNCOMMITTED provides the lowest level of data consistency. A transaction
executing with this isolation level is allowed to: