Four concurrency exceptions and four isolation levels-Database Transaction review

Source: Internet
Author: User

This is the third time in my blog to repeat the isolation level of database transactions. This piece of content is a bit confusing. At that time, I understood it and I will forget it later. I think the trick to master the database transaction isolation level is to list the exceptions that occur during the transaction concurrency and the isolation level to prevent such exceptions. Next we will review the database transaction isolation level based on this idea.

The first possible exception: Lost update)

Database transaction isolation level:Read uncommittedThis exception can be avoided.

The second possible exception: Dirty read)


 

Database transaction isolation level:Read committedThis exception can be avoided.

Third possible exception: unrepeatable read)


Database transaction isolation level:Reaptalble readThis exception can be avoided.

Fourth possible exception: phantom read)


Database transaction isolation level:SerializableThis exception can be avoided.

 

The following table lists the isolation-level control capabilities for various exceptions.


Lu loss update Dr dirty read Nrr non-repeated read SlU Class II loss update PR phantom read
Uncommitted read Ru Y Y Y Y Y
Submit read RC N N Y Y Y
Repeatable read rr N N N N Y
Serial read S N N N N Y

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.