DB2 with UR

Source: Internet
Author: User
Tags terminates

These days query DB2 database, the old encounter select * from XXX with ur, curious what is the role of Ur, now record a bit.

DB2, there are four isolation levels: RS,RR,CS,UR,DB2 provides these 4 different levels of protection to isolate data. Isolation level is an important part of the locking strategy, it directly affects the lock range and the duration of the lock. Two applications, even if the same operation is performed, may result in different locking results due to the different isolation levels chosen.
1, ur (uncommited read) is commonly known as "dirty Read", in the absence of data submitted to be able to read the updated data, is the lowest isolation level, and provides the highest degree of parallelism.
2, CS (cursor stability) in a transaction in the query, allows to read the pre-submission data, the data submitted, the current query can be read to the data, update data when the table is not locked, in this isolation level, the cursor's "current" row is locked. If the row is only read, the lock continues until a new row is accessed or the unit terminates. If the row is modified, the lock continues until the work unit terminates.
3, RS (read stability) Read stability, in a transaction query, not allow to read other transaction update data, allow reading to other transaction committed new data, using read stability, in the same unit of work in a program process retrieved by the entire row will be locked. For a given cursor, it locks all rows that match the result set, for example, if you have a table with 1000 rows and the query returns 10 rows, then only the 10 lines are locked. Read stability uses a medium-level lock.
4, RR (Repeatable Read) is repeatable, repeatable read is the highest isolation level, providing maximum locking and minimal parallelism. All rows that produce the result set are locked, that is, the rows that do not have to appear in the final result sets are locked. No other program can modify, delete, or insert a row that affects the result set until the end of the work unit. Repeat read ensures that the same query that the program makes multiple times in a single unit of work returns results. When querying in a transaction, no data modification is allowed for this query table.

DB2 with UR

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.