Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the mysql transaction isolation level

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly explains "what is the mysql transaction isolation level". The content of the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "what is the mysql transaction isolation level".

Serializable serialization (no problem)

Transactions must be executed sequentially, and the transactions before and after the previous transaction can not be committed, which is the safest, but can not operate concurrently, resulting in inefficiency.

Repeatab read repeatable (default isolation level) (phantom read)

Before a transaction is committed, no matter how many queries are executed in it, the result of the query is the same (even if the record has been modified by another transaction), but false readings may occur.

Read committed read submitted (non-repeatable, phantom read)

The data committed by other transactions in the current transaction can be seen, which may lead to non-repeatable reading (after another thread commits the data, the current thread can see it, and then it will result in different results from the same sql query (repeatable by comparison).

There may also be illusions.

User1 query wangwu is not available, then user2 starts the transaction and inserts wangwu but does not submit data, user1 queries again but does not have it, performs insert wangwu operation, but fails, obviously wangw does not exist but cannot be inserted, illusory reading occurs.

Read uncommitted read not submitted (phantom, non-repeatable, dirty read)

Dirty reading: the current transaction will read the uncommitted data of other transactions. in case other transactions are rolled back, the data read by the current transaction is illegal, which is called dirty reading.

Unrepeatable: changes committed by other transactions are perceived by the current transaction, so the query results are different.

Illusory reading: first of all, user1 query wangwu does not exist, user2 starts the transaction and inserts wangwu but does not commit the transaction, then user1 query wangwu exists and executes

The deletewangwu operation failed. The wangwu was queried but could not be deleted.

Thank you for reading, the above is the content of "what is the mysql transaction isolation level". After the study of this article, I believe you have a deeper understanding of what is the mysql transaction isolation level, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report