当前位置:网站首页>Lock wait timeout exceeded try restarting transaction
Lock wait timeout exceeded try restarting transaction
2022-07-06 12:35:00 【wx5caecf2ed0645】
There have been frequent occurrences in recent projects Lock wait timeout exceeded; try restarting transaction This mistake , It makes us miserable , To solve the problem , Find a lot of information on the Internet , Finally, the problem reappears . The specific operation steps are as follows ( I use mysql The tool is navicat):
First step : Turn on sql Command page

The second step : Input start transaction; Start a transaction
The third step : Input update sentence UPDATE TABLENAME set time=null where id=29163;( Remember not to Submit (commit;))
Step four : Writing tests
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | |
Run the program and run the following 3 individual sql View results
1 2 3 | |
Get the following run results . We found several others trx_state Status is LOCK WAIT, Get the result we want to reproduce

Step five : Wait for the error to appear , After waiting for a period of time, we will find that the program reports an error
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | |
The results obtained from the above , You can know that this error occurs when a transaction is not committed , Other transactions also operate on the same object , So we found the cause of the problem , We can modify it according to this situation .
This is the mistake I encountered this time , Let me share with you , To avoid such a situation in the program .
边栏推荐
- open-mmlab labelImg mmdetection
- [Leetcode15]三数之和
- ES6语法总结--下篇(进阶篇 ES6~ES11)
- Intermediate use tutorial of postman [environment variables, test scripts, assertions, interface documents, etc.]
- Unity场景跳转及退出
- JS Title: input array, exchange the largest with the first element, exchange the smallest with the last element, and output array.
- Vscode basic configuration
- [esp32 learning-2] esp32 address mapping
- JS数组常用方法的分类、理解和运用
- 1041 Be Unique (20 point(s))(哈希:找第一个出现一次的数)
猜你喜欢

Vscode basic configuration

JS function promotion and declaration promotion of VaR variable

基于Redis的分布式锁 以及 超详细的改进思路

Programming homework: educational administration management system (C language)

(1) Introduction Guide to R language - the first step of data analysis

Common properties of location

idea中好用的快捷键

Esp8266 connect onenet (old mqtt mode)

基於Redis的分布式ID生成器

程序设计大作业:教务管理系统(C语言)
随机推荐
Learning notes of JS variable scope and function
Knowledge summary of request
Esp8266 connects to onenet cloud platform (mqtt) through Arduino IDE
数据库课程设计:高校教务管理系统(含代码)
JS数组常用方法的分类、理解和运用
ORA-02030: can only select from fixed tables/views
[899]有序队列
Remember an experience of ECS being blown up by passwords - closing a small black house, changing passwords, and changing ports
Redis based distributed locks and ultra detailed improvement ideas
Redis 缓存更新策略,缓存穿透、雪崩、击穿问题
Gateway fails to route according to the service name, and reports an error service unavailable, status=503
(4) Data visualization of R language -- matrix chart, histogram, pie chart, scatter chart, linear regression and strip chart
Redis based distributed ID generator
[Leetcode15]三数之和
Arduino get random number
Fashion Gen: the general fashion dataset and challenge paper interpretation & dataset introduction
Minio文件下载问题——inputstream:closed
Minio file download problem - inputstream:closed
程序设计大作业:教务管理系统(C语言)
First use of dosbox