当前位置:网站首页>MySQL transaction
MySQL transaction
2022-06-13 00:56:00 【-LM-】
MySQL Business
Business profile
Business : One or a group of sql Statements form an execution unit , Or all , Or none at all .
give an example : Transfer accounts
user A Bank transfer is required , In this case, the transfer amount shall be deducted from the transfer out account , The amount transferred into the account needs to be added , These two operations are performed to ensure data consistency , Both success and failure are required , So you need to use transactions to process .
Relating to affairs sql sentence
commit : Commit transaction
rollback : Roll back the transaction
stay MySQL By default , Transactions are committed automatically , To perform a DML Statement opens the transaction , And automatically commit the transaction
The nature of transactions (ACID)
Atomicity (Atomicity): Transaction is the smallest unit , Can not be further divided . Realize the atomicity of transactions , It's log based Redo/Undo Mechanism .
Uniformity (Consistent): Transaction requires all DML Statement operation , Must guarantee both success and failure . The status before and after the transaction needs to be consistent , It can also be understood as data consistency .
Isolation, (Isolation): Business A And transaction B Isolation between , You can set the isolation level of transactions .
persistence (Durable): It's a guarantee of business , Flag for end of transaction ( Data in memory is persisted to hard disk file ). After a transaction is committed , The state of the transaction is persisted to the database , Update of data 、 Add and other operations will be persisted to the database .
边栏推荐
- Influence of higher order poles on waveform
- Common skills for quantitative investment - indicators Chapter 3: detailed explanation of RSI indicators, their code implementation and drawing
- What is dummy change?
- 蓝桥杯单片机第七届决赛
- [JS] battle chess
- Three column simple Typecho theme lanstar/ Blue Star Typecho theme
- Set sail
- Common skills for quantitative investment - drawing 2: drawing the moving average
- Et5.0 simply transform referencecollectorieditor
- (01). Net Maui actual construction project
猜你喜欢
[JS component] customize the right-click menu
什么是 Meebits?一个简短的解释
How to handle different types of data
sort
Common skills of quantitative investment -- Drawing Part 1: Drawing stock closing price curve and ochl candle chart
[imx6ull] video monitoring project (USB camera +ffmepeg)
Kotlin 协程,job的生命周期
Deep learning model pruning
(01).NET MAUI实战 建项目
Breadth first search for node editor runtime traversal
随机推荐
[Latex] 插入图片
[JS] solve the problem that removeeventlistener is invalid after the class listening event from new is bound to this
Kotlin 协程的作用域构建器 coroutineScope与runBlocking 与supervisorScope,协程同步运行,协程挂掉的时候其他协程如何不被挂掉。
五篇经典好文,值得一看(2)
[imx6ull] video monitoring project (USB camera +ffmepeg)
Androi weather
Canvas game 2048 free map size
The seventh finals of the Blue Bridge Cup
天津银行周传凯:从 0 到 1,我的分布式数据库落地经验谈
Three threads print digital demo alternately
Canvas random bubbling background
Comparison of disk partition modes (MBR and GPT)
Basic operations of FreeMarker
How to solve the duplication problem when MySQL inserts data in batches?
Common skills for quantitative investment - indicators Chapter 3: detailed explanation of RSI indicators, their code implementation and drawing
Rest at home today
Development notes of Mongoose
[JS component] dazzle radio box and multi box
Androi天气
Win10 home vs pro vs enterprise vs enterprise LTSC