Locking in the OLE DB Interface

The following LIBNAME and data set options let you control how the OLE DB interface handles locking. For general information about an option, see LIBNAME Options for Relational Databases.
  • READ_LOCK_TYPE= ROW | NOLOCK
  • UPDATE_LOCK_TYPE= ROW | NOLOCK
  • READ_ISOLATION_LEVEL = S | RR | RC | RU
    The data provider sets the default value. OLE DB supports the S, RR, RC, and RU isolation levels that are defined in this table.
    Isolation Levels for OLE DB
    Isolation Level
    Definition
    S (serializable)
    Does not allow dirty Reads, nonrepeatable Reads, or phantom Reads.
    RR (repeatable Read)
    Does not allow dirty Reads or nonrepeatable Reads; does allow phantom Reads.
    RC (committed Read )
    Does not allow dirty Reads or nonrepeatable Reads; does allow phantom Reads.
    RU (uncommitted Read)
    Allows dirty Reads, nonrepeatable Reads, and phantom Reads.
    Here is how the terms in the table are defined.
    Dirty reads
    A transaction that exhibits this phenomenon has very minimal isolation from concurrent transactions. In fact, it can see changes that are made by those concurrent transactions even before they commit.
    For example, suppose that transaction T1 performs an update on a row, transaction T2 then retrieves that row, and transaction T1 then terminates with rollback. Transaction T2 has then seen a row that no longer exists.
    Nonrepeatable reads
    If a transaction exhibits this phenomenon, it might read a row once. Then, if the same transaction attempts to read that row again, the row might have been changed or even deleted by another concurrent transaction. Therefore, the Read is not (necessarily) repeatable.
    For example, suppose that transaction T1 retrieves a row, transaction T2 then updates that row, and transaction T1 then retrieves the same row again. Transaction T1 has now retrieved the same row twice but has seen two different values for it.
    Phantom reads
    When a transaction exhibits this phenomenon, a set of rows that it reads once might be a different set of rows if the transaction attempts to read them again.
    For example, suppose that transaction T1 retrieves the set of all rows that satisfy some condition. Suppose that transaction T2 then inserts a new row that satisfies that same condition. If transaction T1 now repeats its retrieval request, it sees a row that did not previously exist, a phantom.
  • The default value is set by the data provider. OLE DB supports the S, RR, and RC isolation levels defined in the preceding table. The RU isolation level is not allowed with this option.