MySQL things are isolated

Source: Internet
Author: User

Four characteristics, handling

1, atomicity (atomicity): All operations after the start of the transaction, or all done, or all do not, it is impossible to stagnate in the middle. An error occurred during the execution of the transaction, and it was rolled back to the state before the transaction began, and all operations were as if they had not occurred. This means that the transaction is an indivisible whole, like the atoms that the chemistry has learned, and is the basic unit of the material composition.

2. Consistency (consistency): The integrity constraints of the database are not compromised before and after the transaction begins. For example, a to B transfer, not a deduction of money, B but did not receive.

3, Isolation (isolation): At the same time, only one transaction is allowed to request the same data, and different transactions do not interfere with each other. For example, a is taking money from a bank card, B cannot transfer to this card until the end of the process of taking money.

4. Persistence (Durability): After the transaction is complete, all updates to the database are saved to the database and cannot be rolled back.

Query method:

SELECT @ @tx_isolation;

  

Four levels

Transaction ISOLATION LEVEL Dirty Read Non-REPEATABLE READ Phantom reading
READ UNCOMMITTED (read-uncommitted) Is Is Is
Non-repeatable read (read-committed) Whether Is Is
Repeatable Read (Repeatable-read) Whether Whether Is
Serialization (Serializable) Whether Whether Whether

MySQL things are isolated

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.