当前位置:网站首页>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
| |
边栏推荐
- Big factories are wolves, small factories are dogs?
- DS transunet: Dual Swing transformer u-net for medical image segmentation
- Swiftui 4 new features complete toggle and mixed toggle multiple binding components
- internship:复杂json格式数据编写接口
- EasyCVR集群视频广场页面切换时,请求流未能终止的问题优化
- windows环境 redis安装和启动(后台启动)
- Example explanation: move graph explorer to jupyterlab
- Items in richview documents
- Source code series of authentic children -inheritablethreadlocal (line by line source code takes you to analyze the author's ideas)
- EDA工具对芯片产业的重要性知识科普
猜你喜欢

Richview RichEdit srichviewedit PageSize page setup and synchronization

math_ Use differentiation to calculate approximate value

有意思了!数据库也搞Serverless!

Hls4ml entry method

开发那些事儿:EasyCVR平台添加播放地址鉴权功能

EURA欧瑞E1000系列变频器使用PID实现恒压供水功能的相关参数设置及接线

Solve the problem of slow or failed vscode download

8K HDR!|为 Chromium 实现 HEVC 硬解 - 原理/实测指南

3D panoramic model display visualization technology demonstration

大厂做狼,小厂做狗?
随机推荐
NSI脚本的测试
JS proxy
C#联合halcon应用——大华相机采集类
Summary of SQL aggregate query method for yyds dry goods inventory
Getting started with fastdfs
实战项目笔记(一)——虚拟机的创建
list大集合等比分割成多个小list集合
《软件工程导论(第六版)》 张海藩 复习笔记
Win11快捷键切换输入法无反应怎么办?快捷键切换输入法没有反应
【C语言】详解 memset() 函数用法
运动捕捉系统原理
300题线性代数 第四讲 线性方程组
What if the win11 shortcut key switching input method doesn't respond? Shortcut key switching input method does not respond
Develop those things: easycvr platform adds playback address authentication function
Common components of flask
What if win11 can't pause the update? Win11 pause update is gray. How to solve it?
STC 32位8051单片机开发实例教程 二 I/O工作模式及其配置
关联线探究,如何连接流程图的两个节点
DS transunet: Dual Swing transformer u-net for medical image segmentation
关于new Set( )还有哪些是你不知道的





