当前位置:网站首页>Basic characteristics and isolation level of transactions
Basic characteristics and isolation level of transactions
2022-07-05 13:34:00 【51CTO】
The nature of transactions
Transactions are strictly defined , It has to satisfy four characteristics at the same time , namely Atomicity 、 Uniformity 、 Isolation and persistence , It is also known as ACID characteristic , As follows .
1) Atomicity (Atomic)
Said is ⼀ All operations in a transaction are either successful , All or nothing .
2) Uniformity (Consistency)
It means that the database always starts from ⼀ individual ⼀ The state of causation changes to another ⼀ individual ⼀ The state of being sexual .
3) Isolation, (Isolation)
refer to ⼀ Modification of a transaction before final commit , For other matters is not ⻅ Of .
4) persistence (Durability)
refer to ⼀ Once the transaction is committed , The changes will be permanently saved to the database .
The isolation level of the transaction
| Isolation level | Chinese name |
|---|---|
| read uncommint | Read uncommitted |
| read commit | Read submitted |
| repeatable read | Repeatable |
| serializable | Serialization |
- read uncommit Read uncommitted , You may read uncommitted data from other transactions , It's also called Dirty reading .
- ⽤ The user should have read id=1 Of ⽤ Household age Should be 10, As a result, transactions that have not been committed by other transactions are read , Results read results age=20, This is dirty reading .
- read commit Read submitted , The results of two readings are not ⼀ Cause , It's called non repeatable reading . Non repeatable reading solves the problem of dirty reading , He will only read transactions that have been committed .
- ⽤ The user starts transaction reading id=1⽤ Household , Query to age=10,( Other transactions committed ) Read the result again =20, At the same time ⼀ One transaction ⾥ Same as ⼀ A query Reading different results is called non repeatable .
- repeatable read Repeatable , This is a mysql Of Default level , Is that every time you read the result ⼀ sample , But there are May produce unreal reading .
- serializable strand ⾏,⼀ Generally, it won't make ⽤ Of , He will give everyone ⼀⾏ Lock the read data , Meeting Lead to a lot of timeout and lock competition .
边栏推荐
- Interviewer soul torture: why does the code specification require SQL statements not to have too many joins?
- 龙芯派2代烧写PMON和重装系统
- AVC1与H264的区别
- 53. 最大子数组和:给你一个整数数组 nums ,请你找出一个具有最大和的连续子数组(子数组最少包含一个元素),返回其最大和。
- 【Hot100】34. Find the first and last positions of elements in a sorted array
- [深度学习论文笔记]TransBTSV2: Wider Instead of Deeper Transformer for Medical Image Segmentation
- Write API documents first or code first?
- Word document injection (tracking word documents) incomplete
- 【每日一题】1200. 最小绝对差
- UnicodeDecodeError: ‘utf-8‘ codec can‘t decode byte 0xe6 in position 76131: invalid continuation byt
猜你喜欢

UnicodeDecodeError: ‘utf-8‘ codec can‘t decode byte 0xe6 in position 76131: invalid continuation byt

Interviewer soul torture: why does the code specification require SQL statements not to have too many joins?

Datapipeline was selected into the 2022 digital intelligence atlas and database development report of China Academy of communications and communications

【每日一题】1200. 最小绝对差

南理工在线交流群

Write API documents first or code first?

数据泄露怎么办?'华生·K'7招消灭安全威胁

Mmseg - Mutli view time series data inspection and visualization

MMSeg——Mutli-view时序数据检查与可视化

Record in-depth learning - some bug handling
随机推荐
Win10 - lightweight gadget
通讯录(链表实现)
[MySQL usage Script] catch all MySQL time and date types and related operation functions (3)
Redis6 master-slave replication and clustering
"Baidu Cup" CTF competition in September, web:sql
Idea设置方法注释和类注释
Nantong online communication group
How to apply the updated fluent 3.0 to applet development
CAN和CAN FD
Huawei push service content, read notes
Idea set method annotation and class annotation
AVC1与H264的区别
#从源头解决# 自定义头文件在VS上出现“无法打开源文件“XX.h“的问题
The "Baidu Cup" CTF competition was held in February 2017, Web: explosion-2
ASEMI整流桥HD06参数,HD06图片,HD06应用
Address book (linked list implementation)
APICloud Studio3 WiFi真机同步和WiFi真机预览使用说明
asp.net 读取txt文件
Integer ==比较会自动拆箱 该变量不能赋值为空
爱可生SQLe审核工具顺利完成信通院‘SQL质量管理平台分级能力’评测