当前位置:网站首页>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 | |
边栏推荐
- 8K HDR!|为 Chromium 实现 HEVC 硬解 - 原理/实测指南
- Interesting! Database is also serverless!
- EDA工具对芯片产业的重要性知识科普
- 优质笔记软件综合评测和详细盘点(一) Notion、Obsidian、RemNote、FlowUs
- [Mysql]安装Mysql5.7
- Source code series of authentic children -inheritablethreadlocal (line by line source code takes you to analyze the author's ideas)
- ORA-01950
- 全国职业院校技能大赛网络安全“splunk“详细配置
- Solve the problem of slow or failed vscode download
- STC 32位8051单片机开发实例教程 三 程序编译设置与下载
猜你喜欢
Solve the problem of slow or failed vscode download
渗透工具-TrustedSec 公司的渗透测试框架 (PTF)
Graduation season | Huawei experts teach the interview secret: how to get a high paying offer from a large factory?
math_ Use differentiation to calculate approximate value
windows环境 redis安装和启动(后台启动)
Interview questions shared in today's group
[untitled]
STC 32-bit 8051 single chip microcomputer development example tutorial II i/o working mode and its configuration
GaussDB(for MySQL) :Partial Result Cache,通过缓存中间结果对算子进行加速
全国职业院校技能大赛网络安全“splunk“详细配置
随机推荐
EasyCVR通过国标GB28181协议接入设备,出现设备自动拉流是什么原因?
关于一个神奇函数的用法
Develop those things: easycvr platform adds playback address authentication function
STC 32位8051单片机开发实例教程 三 程序编译设置与下载
Win11暂停更新点不了怎么办?Win11暂停更新是灰色的如何解决?
Écrire un document de blog
【多线程】锁策略
Write blog documents
NSI脚本的测试
How can I know if I want to get the preferential link of stock account opening? Is it safe to open an account online?
Easycvr accesses the equipment through the national standard gb28181 protocol. What is the reason for the automatic streaming of the equipment?
PHP获取微信小程序和小程序商店外链地址
C # joint halcon Application - Dahua Camera Collection class
Common components of flask
Bind this of the current scope for callback functions in other cases such as timers and delayers
Keras machine translation practice
How to prevent repeated submission of new orders
fastDFS入门
What if win11 can't pause the update? Win11 pause update is gray. How to solve it?
Summary of SQL aggregate query method for yyds dry goods inventory