当前位置:网站首页>排他锁(EXclusive Lock)
排他锁(EXclusive Lock)
2022-07-25 15:43:00 【Leon_Jinhai_Sun】
排他锁(EXclusive Lock),又称X锁、独占锁、写锁。针对行锁。
当有事务对数据加写锁后,其他事务不能再对锁定的数据加任何锁,又因为InnoDB对select语句默认不加锁,所以其他事务除了不能写操作外,照样是允许读的(尽管不允许加读锁)。
主要为了在事务进行写操作时,不允许其他事务修改。
加锁方式:
自动:DML语句默认加写锁
手动:select * from T where id=1 for update;
释放方式:
commit、rollback;
边栏推荐
- Pytoch learning notes - Teacher Liu Er RNN advanced chapter - code comments and results
- Why is preparestatement better and safer?
- ServletConfig 类和ServletContext 类
- HDD杭州站·HarmonyOS技术专家分享HUAWEI DevEco Studio特色功能
- 报表工具的二次革命
- Icpc2021 Kunming m-violence + chairman tree
- 如何实现页面包含
- General test case writing specification
- LeetCode - 225 用队列实现栈
- MySQL教程71-WHERE 条件查询数据
猜你喜欢
随机推荐
Implementation of recommendation system collaborative filtering in spark
兆骑科创海内外高层次创新创业人才服务平台,双创成果转化平台
2021hncpc-e-difference, thinking
MySQL教程65-MySQL操作表中数据
I interviewed 8 companies and got 5 offers in a week. Share my experience
LeetCode - 707 设计链表 (设计)
[server data recovery] data recovery cases of raid information loss caused by unexpected power failure of HP EVA server storage
Endnote add Chinese gbt7714 style how to quote documents in word
谷歌博客:采用多重游戏决策Transformer训练通用智能体
Use cpolar to build a business website (how to buy a domain name)
Leetcode - 225 implements stack with queue
Ml image depth learning and convolution neural network
共2600页!又一份神级的面试手册面世~
Pytoch learning notes -- Summary of common functions 2
BSC smart chain contract mode system development details
MySQL教程71-WHERE 条件查询数据
Equivalent change of resistance circuit (Ⅱ)
报表工具的二次革命
MySQL tutorial 71-where conditional query data
Gary Marcus: 学习语言比你想象的更难









