当前位置:网站首页>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 ;边栏推荐
- Detailed explanation of oauth2 - Introduction (I)
- RMAN backup database_ catalogue
- Analysis on China's aluminum foil output, trade and enterprise leading operation in 2021: dongyangguang aluminum foil output is stable [figure]
- Analysis on the development trend of China's intense pulsed light equipment industry in 2021: the market scale is growing, and the proportion of imported brands is large [figure]
- Training of long and difficult sentences in postgraduate entrance examination day81
- 广州华锐互动打造VR展厅全景在线虚拟展厅
- 03 runtime data area overview and threads
- RMAN backup database_ Duplexing backup sets
- [in depth understanding of tcapulusdb technology] tcapulusdb model
- 158_模型_Power BI 使用 DAX + SVG 打通制作商业图表几乎所有可能
猜你喜欢

Under what circumstances do you need to manually write the @bean to the container to complete the implementation class
![Analysis on planting area, output and import of sugarcane in Guangxi in 2021: the output of sugarcane in Guangxi accounts for 68.56% of the total output of sugarcane in China [figure]](/img/c9/f2a8c3c4ddf28d96d8bfc7bc31a4fe.jpg)
Analysis on planting area, output and import of sugarcane in Guangxi in 2021: the output of sugarcane in Guangxi accounts for 68.56% of the total output of sugarcane in China [figure]

Kwai 616 war report was launched, and the essence was thrown away for the second time to lead the new wave. Fast brand jumped to the top 3 of the hot list
![[deeply understand tcapulusdb technology] tmonitor background one click installation](/img/7b/8c4f1549054ee8c0184495d9e8e378.png)
[deeply understand tcapulusdb technology] tmonitor background one click installation
![Overview and trend analysis of China's foreign direct investment industry in 2020 [figure]](/img/b3/73e01601885eddcd05b68a20f83ca8.jpg)
Overview and trend analysis of China's foreign direct investment industry in 2020 [figure]

为什么生命科学企业都在陆续上云?

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

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

Svn introduction and Usage Summary

焕新出发,利尔智达天下
随机推荐
Current situation and trend analysis of China's glass packaging containers in 2021: the revenue of glass packaging containers increases year by year [figure]
Kwai 616 war report was launched, and the essence was thrown away for the second time to lead the new wave. Fast brand jumped to the top 3 of the hot list
[deeply understand tcapulusdb technology] tmonitor background one click installation
[deeply understand tcapulusdb technology] table management of document acceptance
[in depth understanding of tcapulusdb technology] business guide for creating doc acceptance
Differences and relations between sequential table and array (easy to confuse), linear table and linked list
Training of long and difficult sentences in postgraduate entrance examination day81
How to sort massive data? How to process data between memory and hard disk?
07 local method stack
Analysis on planting area, output and import of sugarcane in Guangxi in 2021: the output of sugarcane in Guangxi accounts for 68.56% of the total output of sugarcane in China [figure]
【C语言练习——打印上三角及其变形(带空格版)】
[deeply understand tcapulusdb technology] create a game zone
TCP/IP 测试题(三)
Idea annotation color modification method (clear)
From the perspective of the core competitiveness of ABT, the Internet giant, who fell first
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]
SQL is used for field data types in various databases
QQ robot official plug-in loading configuration method [beta2 version]
Command records of common data types for redis cli operations
Kotlin compose terminate todo project Click to edit and modify todo