11.4. Changing Isolation Levels

The isolation level is not bound to a database. Each application can use a different isolation level so that a different locking mechanism can be applied. Isolation levels can be set at different levels:

  • Session level

  • Application level

  • Statement level

The following sections describe each of these levels.

11.4.1. Using the DB2 Command Window

The current isolation level is stored in a DB2 special register called CURRENT ISOLATION. The special register is a value with two characters (data type of CHAR(2)) of the current isolation level for any dynamic SQL statements issued within the current session.

To obtain the current isolation level value, connect to the database and issue either of these statements:

						VALUES CURRENT ...

Get Understanding DB2®: Learning Visually with Examples now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.