Transaction, transactions

Source: Internet
Author: User

Transaction, transactions

Transaction Features (isolation level) A: atomicity. Transactions are an inseparable unit. C: consistency. transactions must change the database from a consistent state to another consistent state. (For example, transfer) * I: isolation. One transaction cannot be disturbed by other transactions. D: persistence. Once a transaction is committed, it should be permanently saved. Isolation-level classification: read uncommitted: dirty reads, non-repeated reads, and virtual reads are all possible. Read committed: it can avoid dirty reads and avoid repeated reads and virtual reads. Repeatable read: avoids dirty reads and non-repetition. Virtual reads may occur. SERIALIZABLE: avoids dirty reads, non-repetition, and virtual reads. If you do not consider the isolation level of the transaction, the following "Incorrect" occurs: Dirty read: the transaction reads uncommitted data from the other transaction. Repeatable read: for a record, the number of records read before and after the same record is different from that of virtual read (phantom read): for a table, the number of records read before and after is different. MySQL statements that control the transaction isolation level: select @ tx_isolation; // view the current transaction isolation level set transaction isolation level your level (one of four); // set the isolation level

Related Article

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.