当前位置:网站首页>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 ;边栏推荐
- 想知道新股民怎样炒股票开户?在线开户安全么?
- Training of long and difficult sentences in postgraduate entrance examination day88
- [today in history] June 25: the father of notebook was born; Windows 98 release; First commercial use of generic product code
- [deeply understand tcapulusdb technology] transaction execution of document acceptance
- shell-跳出循环-shift参数左移-函数的使用
- 谈谈CNN中的位置和尺度问题
- LeetCode-101-对称二叉树
- Redis configuration (Internet access, password)
- Training of long and difficult sentences in postgraduate entrance examination day84
- 2017 reading (word memory)
猜你喜欢

Detailed explanation of oauth2 - Introduction (I)

两轮市场红海,利尔达芯智行如何乘风破浪?

Sorting out the latest data mining competition scheme!
![Analysis on market scale and supply of China's needle coke industry in 2020 [figure]](/img/79/6b08b62be8768484f548b6e18bd810.jpg)
Analysis on market scale and supply of China's needle coke industry in 2020 [figure]
![[in depth understanding of tcapulusdb technology] tcapulusdb operation and maintenance doc](/img/7b/8c4f1549054ee8c0184495d9e8e378.png)
[in depth understanding of tcapulusdb technology] tcapulusdb operation and maintenance doc

Class 02 loader subsystem
![[in depth understanding of tcapulusdb technology] tcapulusdb operation and maintenance](/img/7b/8c4f1549054ee8c0184495d9e8e378.png)
[in depth understanding of tcapulusdb technology] tcapulusdb operation and maintenance
![[in depth understanding of tcapulusdb technology] tcapulusdb regular documents](/img/7b/8c4f1549054ee8c0184495d9e8e378.png)
[in depth understanding of tcapulusdb technology] tcapulusdb regular documents

Web development solution to cross domain problems

158_模型_Power BI 使用 DAX + SVG 打通制作商業圖錶幾乎所有可能
随机推荐
Tiger DAO VC产品正式上线,Seektiger生态的有力补充
[today in history] June 25: the father of notebook was born; Windows 98 release; First commercial use of generic product code
Detailed explanation of oauth2 - Introduction (I)
[C language practice - print the upper triangle and its deformation (with blank version)]
PHP数据库连接version1.1
Analysis of global tea production, consumption and import and export trade: China's tea production ranks first in the world [figure]
《痞子衡嵌入式半月刊》 第 57 期
In 2021, China's private equity market is growing, and the scale of private equity fund management reaches 19.78 trillion yuan [figure]
Training of long and difficult sentences in postgraduate entrance examination day84
TCP/IP 测试题(二)
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]
Training of long and difficult sentences in postgraduate entrance examination day92
From the perspective of the core competitiveness of ABT, the Internet giant, who fell first
158 Bar _ Modèle Power bi utilise Dax + SVG pour créer des diagrammes d'affaires presque toutes les possibilités
Current situation and development suggestions of China's green PPP project industry: the investment scale is expanding, and the existing problems need to be improved to further promote the healthy dev
GNU nano
[elt.zip] openharmony paper Club - witness file compression system erofs
R language plot visualization: plot visualization of two-dimensional histogram contour (basic 2D histogram contour)
mysql事务讲解
QQ机器人官方插件加载配置方法【beta2版本】