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

Transaction isolation level

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

Transaction isolation is one of the foundations of database processing. Isolation is the abbreviation of I in ACID. When multiple transactions make changes and execute queries at the same time, the isolation level is set to fine-tune the balance between performance and reliability, consistency and result reproducibility. MySQL supports the following isolation levels REPEATABLE READ (the default level used by innodb) READ COMMITTEDREAD UNCOMMITTEDSERIALIZABLEREPEATABLE READ (phantom reading problems occur when executing a range query) this is the default isolation level of innodb Consistent reads in the same transaction take the snapshot established by the first read, which means that if you send the same (unlocked) select statements multiple times in the same transaction, the results returned by these SELECT statements are consistent with each other. READ COMMITTED (with non-repeatable read problem) every consistent read, even in the same transaction, sets and reads its own new snapshot READ UNCOMMITTED (dirty read problem) SELECT statement is done in a non-locked way, but an earlier version of the row data may be used, so, using this isolation level, the read is not consistent, which is called dirty read, otherwise, the isolation level works similar to

SERIALIZABLE (dirty reading, non-repeatable reading, and phantom reading problems will not occur)

This level is a bit like REPEATABLE READ, but innodb implicitly summons all SELECT statements to SELECT. LOCK IN SHARE MODE except in cases where autocommit is prohibited, if autocommit is enabled, SELECT is its own transaction. The main function of transaction isolation is to solve the problems of dirty reading, non-repeatable reading and phantom reading caused by concurrency. Please see my next article for details.

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

Database

Wechat

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

12
Report