How the database works: The isolation level of the transaction (ANSI standard)

Source: Internet
Author: User

Concurrency and data reading

When multiple sessions simultaneously access (manipulate) the same data, there are some unexpected results, including:

– Dirty Read--Dirty reads

-Non-repeatable-non-repeatable reads

-Phantom read-Phantom reads

1. Dirty Reading

Dirty reading means that when a transaction is accessing the data and the data has been modified, and the modification has not yet been submitted to the database, then another transaction accesses the data and then uses the data. Because this data is not yet submitted data, then another transaction read the data is dirty data. Looking at the following diagram may be better understood:

2. Non-repeatable reading

Non-repeatable reading means that in database access, two of the same queries within a transaction range return different data, due to other transactions in the system that have modified the data and submitted it when the query was made. such as transaction T1 read a data, the transaction T2 read and modify the data, T1 read the data again, the discovery and the first read is different.

This is illustrated below:

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.