当前位置:网站首页>MySQL transactions
MySQL transactions
2022-07-19 05:35:00 【Lun Zhi】
One 、 The basic elements of a business (ACID)
1、 Atomicity (Atomicity): All operations after the transaction begins , Or all of them , Or not at all , It's impossible to stay in the middle . An error occurred during the execution of the transaction , It rolls back to the state it was in before the transaction started , All the operations are as if they didn't happen . That is to say, a business is an indivisible whole , It's like atoms in chemistry , Is the basic unit of material composition .
2、 Uniformity (Consistency): Before and after the transaction starts , The database integrity constraint is not broken . such as A towards B Transfer accounts , impossible A Buckle the money ,B Has received .
3、 Isolation, (Isolation): At the same time , Only one transaction is allowed to request the same data , There is no interference between the different transactions . such as A Withdrawing money from a bank card , stay A Before the withdrawal process is over ,B You can't transfer money to this card .
4、 persistence (Durability): After the transaction completes , All updates to the database by the transaction are saved to the database , Cannot be rolled back .
Two 、 Concurrency of transactions
1、 Dirty reading : Business A Read transaction B Updated data , then B Rollback operation , that A The data read is dirty
2、 It can't be read repeatedly : Business A Read the same data multiple times , Business B In the transaction A During multiple reads , The data has been updated and submitted , Cause transaction A When reading the same data multiple times , result atypism .
3、 Fantasy reading : System administrator A Change the scores of all students in the database from specific scores to ABCDE Grade , But the system administrator B At this time, a specific score record was inserted , When the system administrator A After the change, I found that there is another record that hasn't been changed , It's like an illusion , This is called Unreal reading .
Summary : It's easy to confuse unreal reading with unreal reading , Unrepeatable reading focuses on revision , Unreal reading focuses on adding or deleting . To solve the problem of non repeatable reading, we only need to lock the line that meets the condition , To solve unreal reading, we need to lock the watch
边栏推荐
猜你喜欢

解决idea新建module 提示module xxxx does exitst

1.东软跨境电商数仓需求规格说明文档

Use Flink SQL to transfer market data 1: transfer VWAP

C语言&位域

3. Neusoft cross border e-commerce data warehouse project architecture design

利用IDE打jar包

11.数据仓库搭建之DWS层搭建

The latest news of spring recruitment in 2022: the average salary of it Internet industry is 18500 yuan

C语言的宏定义

ambari2.7.5集成es6.4.2
随机推荐
表字段属性查询
微信小程序的自定义组件
电商用户行为实时分析系统(Flink1.10.1)
The latest news of spring recruitment in 2022: the average salary of it Internet industry is 18500 yuan
5.1 business data acquisition channel construction of data acquisition channel construction
Using Flink SQL to fluidize market data 2: intraday var
3. Neusoft cross border e-commerce data warehouse project architecture design
Common interview questions of operating system
对象转map
MySQL -- storage and cursor
SnackBar源码解析及封装
Use Flink SQL to transfer market data 1: transfer VWAP
Syntax differences between PgSQL and Oracle (SQL migration records)
D3.V3.js数据可视化 -- 力导向图之图片和提示
1 SparkSQL概述
MySQL cache solution problem solving
线程池如何监控,才能帮助开发者快速定位线上错误?
MySQL学习笔记(4)——(基本CRUD)操作数据库中的表的数据
判断素数
6.数据仓库搭建之数据仓库设计