IBM PureData System for Analytics, Version 7.1

SET TRANSACTION ISOLATION LEVEL

Use the SET TRANSACTION ISOLATION LEVEL command to set the transaction characteristics of the current session.

Syntax

Syntax for setting a transaction:
SET TRANSACTION ISOLATION LEVEL { READ WRITE | READ ONLY | SERIALIZABLE }

Inputs

The SET TRANSACTION command takes the following inputs:
Table 1. SET TRANSACTION inputs
Input Description
READ WRITE Allows a user to read and update a database. This is the default.
READ ONLY During the session, a user can read from a database but not write to it. If the user attempts to write to the database, the system returns an error code. The user can create and write to temporary tables.
SERIALIZABLE The isolation level of a transaction determines what data that transaction can see when other transactions are running concurrently. When the isolation level is serializable, the current transaction can see only rows that are committed before the first query or data-modification statement is started in this transaction. Consequently, two concurrent transactions leave the database in the same state that they would if the two transactions ran one after the other in either order.
If you specify one of the following isolation levels, that setting is ignored and SERIALIZABLE is used:
  • READ UNCOMMITTED
  • READ COMMITTED
  • REPEATABLE READ

Output

The SET TRANSACTION command has the following output:
Table 2. SET TRANSACTION output
Output Description
SET VARIABLE The command was successful.

Privileges

You must be an administrator, or you must be able to connect to the database and schema.

Usage

The following provides sample usage.
  • Set the transaction isolation level:
    MYDB.SCH1(USER)=> SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
       SET VARIABLE


Feedback | Copyright IBM Corporation 2014 | Last updated: 2014-02-28