当前位置:网站首页>mysql事务的四大特性以及隔离级别
mysql事务的四大特性以及隔离级别
2022-07-26 00:10:00 【Camellia——】
-- 事务在操作时的理想状态: 所有的事务之间保持隔离,互不影响。因为并发操作,多个用户同时访问同一个 数据。可能引发并发访问的问题:
-- 脏读:一个事物读取到另一个事物中尚未提交的数据
-- 幻读:一个事务中两次读取的数据的数量不一致,要求在一个事务多次读取的数据的数量是一致 的,这是 insert 或 delete 时引发的问题
-- 不可重复读:一个事物中两次读取的数据不一致,要求的是一个事务中多次读取时数据是一致的,这 是事务 update 时引发的问题
-- 事物的四大特性A(原子性)C(一致行)I(隔离性)D(持久性)
-- 事物的隔离级别
-- read uncommited:读未提交(级别最低,安全性最差)会出现脏读、不可重复读、幻读
-- read commited:读已提交(能够防止脏读),会出现不可重复读、幻读
-- repeatable read:可重复读(防止脏读,不可重读问题),不能防止幻读
-- serializable:串行化(可以防止脏读、不可重读、幻读),效率(性能低)-- 事务的隔离级别越高,安全性最高但是性能最低!
-- 查看事务的隔离级别
SELECT @@tx_isolation; -- mysql的默认的隔离级别:repeatable read:可重复读!
边栏推荐
猜你喜欢

Binary tree -- 111. Minimum depth of binary tree

Recent impressions about bull market and defi 2021-05-17
![[英雄星球七月集训LeetCode解题日报] 第25日 树状数组](/img/e6/a59a1719c4381772ce7475d59d5068.png)
[英雄星球七月集训LeetCode解题日报] 第25日 树状数组

Security document archiving software

07_ue4进阶_发射火球扣mp值和攻击扣血机制

URL address mapping configuration

Backtracking - 77. combination

牛市还没有结束,还有下半场 2021-05-18

Binary tree -- 222. Number of nodes of a complete binary tree

Piziheng embedded: the method of making source code into lib Library under MCU Xpress IDE and its difference with IAR and MDK
随机推荐
试除法--3的幂
[英雄星球七月集训LeetCode解题日报] 第25日 树状数组
LeetCode_55_跳跃游戏
Yolov4 tiny network structure
FreeRTOS personal notes - mutex
Unity—欧拉角,四元数
Binary tree - 617. Merge binary tree
After using MQ message oriented middleware, I began to regret
Leetcode169 detailed explanation of most elements
Stm32- analyze latency based on assembly
复盘:推荐系统—— 负采样策略
"Demons dance", is the bull market over? 2021-05-13
Piziheng embedded: the method of making source code into lib Library under MCU Xpress IDE and its difference with IAR and MDK
Installation and configuration of VMware esxi7.0
Find the intermediate node of the linked list
SSM environment integration
IP核:PLL
bond网卡模式配置
Sliding window_
Js理解之路:Object.call与Object.create()实现继承的原理