当前位置:网站首页>Oracle deadlock test
Oracle deadlock test
2022-07-01 20:27:00 【Hua Weiyun】
1, Build a test table
create table l (id int);insert into l values(1);insert into l values(2);
2, Perform lock test
Need to open 2 One session .
conversation 1 | conversation 2 |
select * from l where id=1 for update; | |
select * from l where id=2 for update; | |
select * from l where id=2 for update; ---- Wait for session 2 Submit . | |
select * from l where id=1 for update; ---- Wait for session 1 Submit . | |
SQL> select * from l where id=2 for update; | |
// You need to perform commit,rollback. conversation 2 Can be executed normally . |
3,PG Lock test
conversation 1 | conversation 2 |
begin; | begin; |
select * from l where id=1 for update; | |
select * from l where id=2 for update; | |
select * from l where id=2 for update; # Conversation waiting 2 | |
select * from l where id=1 for update; # conversation 2 Report errors , conversation rollback; postgres=*# select * from l where id=1 for update; postgres=!# select * from l where id=2 for update; | |
# conversation 1 Normal execution . It's ok commit | |
边栏推荐
猜你喜欢
由浅入深学会白盒测试用例设计
GaussDB(for MySQL) :Partial Result Cache,通过缓存中间结果对算子进行加速
[untitled]
Interview question 1
关联线探究,如何连接流程图的两个节点
EasyCVR集群视频广场页面切换时,请求流未能终止的问题优化
cocoaPods 添加成功后,导入不了头文件或者not found file 报错
fastDFS入门
How to connect the two nodes of the flow chart
After adding cocoapods successfully, the header file cannot be imported or an error is reported in not found file
随机推荐
架构师毕业总结
【蓝桥杯Web】2022年第十三届蓝桥杯Web大学组国赛真题解析
How can a programmer grow rapidly
Stack overflow 2022 developer survey: where is the industry going?
Importance of EDA tools to chip industry knowledge popularization
网上开户是安全的吗?新手可以开炒股账户吗。
switch 有四样写法你知道么
想得到股票开户的优惠链接,如何得知?在线开户是安全么?
使用Zadig从0到1搭建持续交付平台
Hls4ml/vivado HLS error reporting solution
Iframe parent-child page communication
Interview questions shared in today's group
Principle of motion capture system
SwiftUI 4 新功能大全之 Toggle与 Mixed Toggle 多个绑定组件
The large list set is divided into multiple small list sets in equal proportion
STC 32-bit 8051 single chip microcomputer development example tutorial three program compilation setting and download
Develop those things: easycvr cluster device management page function display optimization
[untitled]
math_ Use differentiation to calculate approximate value
Data analysts sound tall? Understand these points before you decide whether to transform