Isolation level of the sql-database

Source: Internet
Author: User

Read uncommited (not submitted)

Lowest level, data that can read uncommitted things, which leads to dirty reads, for example: Session a modifies a data at some point, but is not committed, and session B reads the data, which is, session a rolls back the thing, which results in inconsistent state of the data, which is dirty read! Read commited (submit reading)Avoid dirty reading, but will result in non-repeatable reads, for example: a time session A in a thing to query a data, the data is 1, which is the session B modified the value of the data is 2, and submitted, at this time, session A of the thing has to read the data, this is the data is 2, it appears the same transaction, read the result is not the same, this is not repeatable read (This is the default level for both Oracle and Ms-sql) REPEATABLE READ (repeatable Read)The default transaction isolation level of the MySQL InnoDB storage engine solves the problem of non-repeatable reads, but Phantom reads can occur; When a transaction reads a range of data rows, another transaction inserts the data, and when the user reads again, a new phantom line is found. For phantom Reading, the InnoDB storage engine solves the phenomenon of phantom reading effectively through multiple versioning concurrency control (MVCC). SERIALIZABLE (Serializable)The highest isolation level, which enforces the ordering of transactions. So that there is no conflict between transactions, so as to solve the phantom read phenomenon, at this level, the concurrency of the database is greatly limited, under serializable, each read data row to be locked. Summary: The lower the isolation level, the better the concurrency of the transaction, but it can also compromise the consistency of the data. the higher the isolation level, the worse the concurrency of the transaction!

Isolation level of the sql-database

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.