Difference between revisions of "SET TRANSACTION"

From Recital Documentation Wiki
Jump to: navigation, search
(Class)
Line 1: Line 1:
 
 
 
==Purpose==
 
==Purpose==
 
To set the current transaction state
 
To set the current transaction state
Line 50: Line 48:
  
 
==Products==
 
==Products==
Recital Server, Recital
+
Recital Recital
 
[[Category:Documentation]]
 
[[Category:Documentation]]
 
[[Category:Commands]]
 
[[Category:Commands]]

Revision as of 15:44, 25 November 2009

Purpose

To set the current transaction state


Syntax

SET TRANSACTION [READ ONLY | READ WRITE]

SET TRANSACTION ISOLATION LEVEL <isolation-level>


See Also

CLOSE, Configuration Files, DECLARE CURSOR, DROP CURSOR, FETCH, OPEN, SELECT, TXLEVEL(), TXNISOLATION(), TXNLEVEL()


Description

A current transaction state can be either read-only or read-write. Three further aspects of transaction behavior are configurable: dirty reads, non-repeatable reads and phantom reads. Dirty reads occur when a transaction updates a row, then a second transaction reads that row before the first transaction commits. If the first transaction rolls back the change, the information read by the second transaction becomes invalid. Non-repeatable reads occur when a transaction reads a row then another transaction updates the same row. If the second transaction commits, subsequent reads by the first transaction get different values than the original read. Phantoms occur when a transaction reads a set of rows that satisfy a search condition and then another transaction updates, inserts, or deletes one or more rows that satisfy the first transaction’s search condition. In this case, if the first transaction performs subsequent reads with the same search condition, it reads a different set of rows.

If you use a SET TRANSACTION statement, it must be the first statement in your transaction.

NOTE: This command can also be used as a standard SET COMMAND in the config.db file, to set the transaction state on a system or application wide basis.


Keywords Description
READ ONLY Set the default transaction type to read-only.
READ WRITE Set the default transaction type to read-write.
ISOLATION LEVEL Specify how the transaction will perform.
SERIALIZABLE This will disable dirty reads, non-repeatable reads and phantom reads. This is the default isolation level.
REPEATABLE READ This will disable dirty reads, non-repeatable reads and enable only phantom reads.
READ UNCOMMITTED This will enable dirty reads, non-repeatable reads and phantom reads.
READ COMMITTED This will disable dirty reads and enable non-repeatable reads and phantom reads.


Example

set transaction isolation level read uncommitted


Products

Recital Recital