Default Isolation Level
- Last Updated: October 12, 2022
- 2 minute read
- DataDirect Connectors
- ODBC
- IBM Db2 8.0
- Documentation
Default Isolation Level
Attribute
DefaultIsolationLevel (DIL)
Purpose
Specifies the method by which locks on data in the database are acquired and released.
The following table shows how ODBC isolation levels map to Db2 isolation levels.
| ODBC | Db2 |
|---|---|
| Read Uncommitted | Uncommitted Read |
| Read Committed | Cursor Stability |
| Repeatable Read | Read Stability |
| Serializable | Repeatable Read |
Refer to Locking and isolation levels in the Progress DataDirect for ODBC Drivers Reference for details.
Valid Values
0 | 1 | 2 |
3 | 4
Behavior
If set to 0 (READ_UNCOMMITTED), other processes can be
read from the database. Only modified data is locked and is not released until the
transaction ends.
If set to 1 (READ_COMMITTED) other processes can change a
row that your application has read if the cursor is not on the row you want to change. This
level prevents other processes from changing records that your application has changed until
your application commits them or ends the transaction.
It also prevents your application from reading a modified record that has not been committed by another process, unless the Concurrent Access Resolution connection option is set to:
- Automatic (0) and the cur_commit server parameter is set to On
- Use Currently Committed (2) and the cur_commit server parameter is set to On or Available
In either of these cases, the application can read the last committed value. See the connection option Concurrent Access Resolution for further details.
See Cursor Stability isolation level for information about enhancements to the Read Committed (Cursor Stability) isolation level.
If set to 2 (REPEATABLE_READ), other processes are
prevented from accessing data that your application has read or modified. All read or
modified data is locked until transaction ends.
If set to 3 (SERIALIZABLE), other processes are prevented
from changing records that are read or changed by your application (including phantom
records) until your program commits them or ends the transaction. This level prevents the
application from reading modified records that have not been committed by another process.
If your application opens the same query during a single unit of work under this isolation
level, the results table will be identical to the previous table; however, it can contain
updates made by your application.
If set to 4 (NONE), your application can read modified records even if they have not been committed by another application. This level can only be set in the data source, not from the application. (This level is valid only on Db2 for i, and is the only isolation level that works for collections that have journaling disabled.)
Default
1 (READ_COMMITTED)