当前位置:网站首页>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 .
边栏推荐
- BeanShell script gets the current time
- SSTI模板注入
- 2022 latest software testing tools
- 服务器知识(详情)
- [tools] unity2d character controller, which controls 2D players to move and jump in four directions and horizontal directions
- 树状数组与ST表
- SSTI模板注入
- Inverse yuan (I'll add these words if there are too many people using the name)
- 逻辑漏洞----身份验证漏洞
- SoloPi APP性能测试用
猜你喜欢
随机推荐
[tools] unity screen drawing line, unity screen drawing Hsj drawing tool
第2章-系统控制原理 -> 经典控制理论
[unity Editor Extension] unity makes its own exclusive editor panel
项目性能优化实战:解决首页白屏问题,自定义 loading 动画优化首屏效果
BeanShell script gets the current time
postman的json脚本转jmeter的jmx脚本
uniapp微信小程序登录(先授权微信后授权手机号)-- (1)
理解:什么是接口,接口的概念
GoReplay
Summary of tree and heap knowledge points
Bugku problem solution
新手如何配置多个 SSH Key(通俗易懂手把手教学)
网络层协议和IP数据包的格式(详解)
Injection de modèles ssti
剑指 Offer 53 - I. 在排序数组中查找数字 I
攻防世界----shrine
最长上升子序列----优化
GoReplay
Network layer protocol and IP packet format (detailed)
【Unity编辑器扩展】Unity发布资源到商店流程Unity Asset Store Publish