当前位置:网站首页>2022.6.28-database-1 Isolation level of database
2022.6.28-database-1 Isolation level of database
2022-07-19 02:32:00 【HYYyyying】
attention!!! Transferred from a Xiu , Personal boredom casually excerpts
Uncommitted read
Changes have taken place in the transaction , Even if it's not submitted , Other things can also be seen , For example, for a number A original 50 It is amended as follows 100, But I haven't submitted the changes , Another transaction sees this change , At this time, the original transaction is rolled back , Now A still 50,, But another thing to see A yes 100. May cause Dirty reading 、 Fantasy reading 、 It can't be read repeatedly .
Submit to read
For a transaction from the beginning until the commit , Any changes made are invisible to other transactions , For example, for a number A Turned out to be 50, Then submit the changes to 100, Another business is at this time A Before submitting the changes , Read the A yes 50, Just finished reading ,A It was modified to 100, At this time, another transaction will perform read discovery A It suddenly became 100 了 ; Can prevent dirty reading , But phantom or unrepeatable reads can still occur .
Repeated reading
It means that the records read multiple times for a record are the same , For example, for a number A The words read have always been A, Read twice before and after A It's consistent ; Can prevent dirty and unrepeatable read , But unreal reading can happen .
Serializable reading
In the case of concurrency , The reading result of serialization is consistent , There is no difference , For example, there will be no dirty reading and unreal reading , This level prevents dirty reads 、 Unrepeatable reading and phantom reading .
MYSQL innoDB The default isolation level supported by the storage engine is repeatable
1、 Dirty reading : Dirty reading is when a transaction is accessing data , And the data has been modified , This modification has not yet been committed to the database , At this time , Another transaction also accesses this data , And then I used this data .
2、 It can't be read repeatedly : Within a transaction , Read the same data multiple times . Before the end of the business , Another transaction also accesses the same data . that , Between two reads in the first transaction , Due to the modification of the second transaction , So the data read by the first transaction twice may be different . This happens that the data read twice in a transaction is different , So it's called unrepeatable reading .
3、 Fantasy reading : A phenomenon that occurs when a transaction is not executed independently , For example, the first transaction modifies the data in a table , This modification involves all data rows in the table . meanwhile , The second transaction also modifies the data in this table , This modification is to insert a new row of data into the table . that , In the future, the user who operates on the first transaction will find out whether there are any modified data rows in the table , It's like an illusion .
边栏推荐
- Buaaos-lab0 experimental report
- 脏读、幻读、不可重复读
- Summary of tree and heap knowledge points
- Chapter 2 - system control principle - > classical control theory
- Inverse yuan (I'll add these words if there are too many people using the name)
- 项目性能优化实战:解决首页白屏问题,自定义 loading 动画优化首屏效果
- GoReplay
- 种下一颗种子,十年后长成了参天B+树
- 已知先序遍历中序遍历,求树的层序遍历
- 最长上升子序列----优化
猜你喜欢
随机推荐
【已解决】参考了本地mysql忘记密码后, [Server] --initialize specified but the data directory has files in it. Aborti
[antv G2] how to solve the memory leak caused by G2
静态路由(详)
Unity导入fbx模型后,运行时物体的旋转和位置自动改变的问题解决方法
怎么做好测试用例评审
UE4 notes
【Unity编辑器扩展】Unity制作自己的专属的编辑器面板
西加加
STL -- deque container
[unity Editor Extension] the pre-processing and post-processing pictures of unity assets are automatically transferred to sprite2d
种下一颗种子,十年后长成了参天B+树
理解:什么是接口,接口的概念
How to use nmon
Chapter 2 - system control principle - > classical control theory
Buaaos-lab0 experimental report
Jmeter响应时间测试组件&多接口并发
Unity3D 游戏人物跳跃落地时发生弹跳,偏移情况的解决方法
Analysis of the paradise of metauniverse developers the ecological value of the metauniverse protocol caduceus
简单记录一下并查集
Lecture 2 BTC cryptography principles (notes)







