Mysql Transaction Processing

Source: Internet
Author: User

Mysql Transaction Processing

1. transactions are not dedicated to mysql

2. ACID properties of transactions

1) atomicity)

A transaction must be regarded as an inseparable minimum unit of work. All operations in the entire transaction are either committed successfully or rolled back. For a transaction, it is impossible to execute only one part of the transaction.

Operation, which is the atomicity of the transaction.

2) consistency)

The database always changes from a consistent state to another consistent state.

3) isolation)

Generally, modifications made by a firm are invisible to other transactions before the final commit.

4) durability)

Once a transaction is committed, the modifications made will be permanently saved to the database.

3. isolation level

1) read uncommitted (uncommitted read)

At this level, the transaction is modified. Even if it is not committed, it is visible to other transactions.

2) read committed (submit READ)

It is invisible to other transactions before committing

3) repeatable read (repeatable read) [mysql Default transaction isolation level]

This level ensures that the results of reading the same record multiple times in the same transaction are consistent.

However, phantom read problems may occur.

4) SERIALIZABLE (SERIALIZABLE)

This level locks each row of data read.

 

Isolation level Dirty read possibility Possibility of non-repeated reading Phantom read possibility Lock read
READ UNCOMMITED Yes Yes Yes No
READ COMMITTED No Yes Yes No
REPEATABLE READ No No Yes No
SERIALIZABLE No No No Yes

 

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.