DB2 isolation level-read for implementation

Source: Internet
Author: User

As one of the DB2 isolation levels, unimplemented read operations are very important to the DB2 database. The following describes the implemented read levels in detail, we hope that you will have a deeper understanding of the DB2 isolation level.

Unimplemented read UR) allows applications to access unimplemented changes of other transactions. Unless other applications attempt to delete or change the table, the application will not lock the row being read and make other applications unable to access the row. For read-only and updatable cursors, the "unimplemented read" operation method is different.

Read-Only cursors can access unimplemented changes of most other transactions. However, when the transaction is being processed, tables, views, and indexes that are being created or deleted by other transactions cannot be used. Any other changes to other transactions can be read before implementation or rollback.
Note: The updatable operation cursors at the "unimplemented read" isolation level will work in the way of cursor stability at the DB2 isolation level.
When it uses the isolation level UR to run the program, the application can use the DB2 isolation level CS. This occurs because the cursor used in the application is a fuzzy cursor. Because of the BLOCKING option, you can upgrade the fuzzy cursor to the isolation level CS. The default value of the BLOCKING option is UNAMBIG. This means that the fuzzy cursor is treated as updatable, And the DB2 isolation level is upgraded to CS. To prevent this upgrade, you have two options:

* Modify the cursor in the application. So that these cursors are non-fuzzy cursors. Change the SELECT statement to include the for read only clause.

* The fuzzy cursor is retained in the application, but is pre-compiled or bound to it using the blocking all and staticreadonly yes options to allow any fuzzy cursor to be considered as a read-only cursor when running the program.

For example, the example of "Repeatable read" for scanning 10000 rows is the same. If "unimplemented read" is used, no row locking is required.

When "unimplemented reading" is used, non-repeated reading behaviors and phantom reading may occur. The "unimplemented read" isolation level is most commonly used for queries on read-only tables, or if you only execute the selection statement and do not care if you can see unimplemented data from other applications, it is also the most commonly used.


 

Use of DB2 dynamic SQL

Implementation of DB2 circular Query

DB2 Data Warehouse Product Introduction

Implementation of DB2 Paging

DB2 cursor and usage

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.