Database transaction ISOLATION LEVEL-Parse dirty Read & non-repeatable READ & Phantom Read

Source: Internet
Author: User

Isolation level of a database transaction

There are 4 isolation levels for database transactions, from low to high, READ UNCOMMITTED,Read Committed,Repeatable read, andSerializable, which can be resolved individually by each of the four levels Problems such as dirty reading, non-repetition reading, and Phantom reading.

1. READ UNCOMMITTED (not submitted)

The lowest isolation level. One transaction can read the results of an update that is not committed by another transaction.

2. Read Committed (Reading submit)

The default isolation level used by most databases. The result of an update operation for a transaction is that only after the transaction commits, another transaction can read the result after the same data update.

3. Repeatable read (repeat Read)

The default level for MySQL. During the entire transaction, the same data is read in the same way, regardless of whether the other transaction is updating the shared data or not, whether the update is committed or not.

4. Serializable

The highest isolation level. All transaction operations are executed sequentially. Note that this results in lower concurrency and the worst performance. It is usually replaced with a different concurrency level plus the corresponding concurrency lock mechanism.

Concurrency problems caused by two different transaction levels

1 Dirty Reads

Dirty reads occur when a transaction a reads a data that has been modified by another transaction B, but has not yet committed. If B is rolled back, transaction a reads invalid data. This is similar to non-repeatable reads, but the second transaction does not require a commit.

Database transaction ISOLATION LEVEL-Parse dirty Read & non-repeatable READ & Phantom Read

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.