当前位置:网站首页>MySQL transaction explanation
MySQL transaction explanation
2022-06-25 18:53:00 【Wind breaking】
mysql Storage engine :
View engine mode :SHOW ENGINES;
Not all storage engines support things in the storage engine ,innodb stay 5.0 Things are supported after version , and myisam and memory It doesn't support things .
mysql Transaction features ACID:
Atomicity : The business is indivisible , Either all success or all failure , Bundled execution .
Uniformity : The data must be consistent , If you transfer money, add 1000 and subtract 1000 , The total amount is
two thousand ,( The consistent state of one data to the consistent state of another data ) No matter how you operate
The total data will not change .
Isolation, : A transaction cannot be disturbed by other things when it is executed , Other things can be locked if they want to be executed
persistence : Once a transaction is executed, it cannot be modified , Once submitted to the database, the data will be permanently modified .
Transaction creation :
Implicit things : For example, we usually carry out insert、update、delete. He will help us open implicit things by default .
Show things : A transaction has distinct open and end tags . However, the prerequisite is that the auto submit function must be set to disabled
Open process :
Auto submit function off
set autocommit=0;
Opening things
start transaction;
To write SQL Add, delete, change and check the sentences ......
success :commit; Submit things
Failure :rollback; Things roll back Transaction isolation mechanism :
Dirty reading : For the query , It means that two transactions perform data operations at the same time , The data read is different .
It can't be read repeatedly : It means that the data cannot be read repeatedly after being read once , Avoid inconsistency between two data reads .
Fantasy reading : Unreal reading generally refers to adding and deleting , It means that more data is read in the second time after the data is read in the first time
One line or less , This is called Unreal reading .
Transaction isolation level :
Dirty reading It can't be read repeatedly Fantasy reading
read uncommitted √ √ √
read committed × √ √
repeatable read × × √
serializable × × ×
mysql The default is repeatable read Isolation level
View the isolation level command : select @@tx_isolation;
Set isolation level command : set session|global transaction isolation level Isolation level ;边栏推荐
- Oriental Wealth function (the most complete edition of Childe Yong)
- Electronic basic project construction & communication between main thread and rendering thread
- 正则表达式总结
- [deeply understand tcapulusdb technology] create a game zone
- Move graph explorer to jupyterab: use ges4jupyter to connect ges and explore graphs
- Addition, deletion, modification and query of mysql~ tables (detailed and easy to understand)
- 158 Bar _ Modèle Power bi utilise Dax + SVG pour créer des diagrammes d'affaires presque toutes les possibilités
- [deeply understand tcapulusdb technology] tmonitor background one click installation
- TCP/IP 测试题(四)
- Apifox简单了解——WEB端测试的集大成者
猜你喜欢
![Analysis on development status and development suggestions of e-commerce industry in Xinjiang in 2020 [figure]](/img/d1/8ed2958ef365e17494bade6e29ee04.jpg)
Analysis on development status and development suggestions of e-commerce industry in Xinjiang in 2020 [figure]

LeetCode-78-子集

揭秘GES超大规模图计算引擎HyG:图切分
![[deeply understand tcapulusdb technology] table management of document acceptance](/img/7b/8c4f1549054ee8c0184495d9e8e378.png)
[deeply understand tcapulusdb technology] table management of document acceptance

158_模型_Power BI 使用 DAX + SVG 打通制作商业图表几乎所有可能
![Analysis on policy, output and market scale of China's natural gas hydrogen production industry in 2020 [figure]](/img/f2/ec0fe8bec503c8788d6d549845b95c.jpg)
Analysis on policy, output and market scale of China's natural gas hydrogen production industry in 2020 [figure]

Redis 5.0 data structure double end linked list source code analysis

Addition, deletion, modification and query of mysql~ tables (detailed and easy to understand)

Redis configuration (Internet access, password)
![Development status of China's hydrotalcite industry in 2020 and analysis of major enterprises: the market scale is rapidly increasing, and there is a large space for domestic substitution [figure]](/img/2c/05f2aa467edb76095e30a117adc251.jpg)
Development status of China's hydrotalcite industry in 2020 and analysis of major enterprises: the market scale is rapidly increasing, and there is a large space for domestic substitution [figure]
随机推荐
QQ机器人疫情查询/疫情关注等【最新beta2版本】
【C语言练习——打印上三角及其变形(带空格版)】
From the perspective of the core competitiveness of ABT, the Internet giant, who fell first
QQ robot epidemic situation query / epidemic situation concern [latest beta2 version]
[C language practice - print the upper triangle and its deformation (with blank version)]
最新數據挖掘賽事方案梳理!
Training of long and difficult sentences in postgraduate entrance examination English Day82
User management and permissions
Sorting out the latest data mining competition scheme!
Kotlin compose terminate todo project Click to edit and modify todo
什么是算子?
Under what circumstances do you need to manually write the @bean to the container to complete the implementation class
《痞子衡嵌入式半月刊》 第 57 期
Use pagoda to set up mqtt server
网络安全检测与防范 测试题(二)
GenICam GenTL 标准 ver1.5(1)
Analysis of global tea production, consumption and import and export trade: China's tea production ranks first in the world [figure]
07 local method stack
网络安全检测与防范 测试题(一)
Overview and trend analysis of China's CT examination equipment industry in 2021 [figure]