Read stability at the DB2 isolation level

Source: Internet
Author: User

The read stability in DB2 is the knowledge that every DBA must master. It ensures that "non-repeated reading" is not possible and deserves further study.

Read stability RS) only lock the rows retrieved by the application in the work unit. It ensures that any qualified row reads during the execution of a work unit are not modified by other application processes before a work unit is completed, make sure that no rows changed by another application process are read until the process implements these changes. That is to say, there is no possibility of "non-repeated reading.

Different from repeatable reading, if your application sends the same query multiple times when "read stability" is used, you may see additional phantom row phantom reading ). When you rereference the example of scanning 10000 rows, "Read stability" only locks the specified row. In this way, when "read stability" is used, only 10 rows are retrieved, and only the 10 rows are suspended for locking. Compare it with "repeatable". In this example, the Repeatable read suspends the lock on all 10000 rows. The pending locks can be shared, the next share, update, or mutex lock.
Note: The "read stability" DB2 isolation level ensures that all returned data remains unchanged until the application sees the data, even if temporary tables or row blocks are used.

One of the goals of the "read stability" DB2 isolation level is to provide a high degree of parallelism and a stable view of data. To help achieve this goal, the optimizer ensures that the table-Level Lock is not obtained before the lock upgrade occurs.
"Read stability" DB2 isolation level is most suitable for applications that include all of the following features:

* Run in a concurrent Environment
* It is necessary to limit the stability of some rows during the unit of work.
* The same query is not sent multiple times in the work unit, or the same query is not required to obtain the same answer when multiple queries are sent in the same work unit.
 

Use of DB2 dynamic SQL

Implementation of DB2 circular Query

DB2 query Management Utility

Learn about the DB2 data warehouse center

How to query and create a table using DB2

Related Article

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.