当前位置:网站首页>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 .
边栏推荐
- Navigator object (determine browser type)
- [offer18] delete the node of the linked list
- @The difference between Autowired and @resource
- Design and implementation of general interface open platform - (39) simple and crude implementation of API services
- C programming exercise
- Page performance optimization of video scene
- 1041 be unique (20 points (s)) (hash: find the first number that occurs once)
- [leetcode19] delete the penultimate node in the linked list
- 编译原理:源程序的预处理及词法分析程序的设计与实现(含代码)
- Pat 1097 duplication on a linked list (25 points)
猜你喜欢
Derivation of logistic regression theory
Gravure sans fil Bluetooth sur micro - ordinateur à puce unique
Pat 1097 duplication on a linked list (25 points)
There is no red exclamation mark after SVN update
JS function promotion and declaration promotion of VaR variable
Whistle+switchyomega configure web proxy
Custom view puzzle getcolor r.color The color obtained by colorprimary is incorrect
JS Title: input array, exchange the largest with the first element, exchange the smallest with the last element, and output array.
Redis cache update strategy, cache penetration, avalanche, breakdown problems
Programmers can make mistakes. Basic pointers and arrays of C language
随机推荐
PT OSC deadlock analysis
燕山大学校园网自动登录问题解决方案
(课设第一套)1-4 消息传递接口 (100 分)(模拟:线程)
单片机蓝牙无线烧录
Cannot change version of project facet Dynamic Web Module to 2.3.
Redis 缓存更新策略,缓存穿透、雪崩、击穿问题
[leetcode15] sum of three numbers
JS function promotion and declaration promotion of VaR variable
2021.11.10 compilation examination
Design and implementation of general interface open platform - (39) simple and crude implementation of API services
Kconfig Kbuild
GCC compilation options
Fashion Gen: the general fashion dataset and challenge paper interpretation & dataset introduction
Knowledge summary of request
Arm pc=pc+8 is the most understandable explanation
Minio文件下载问题——inputstream:closed
Générateur d'identification distribué basé sur redis
ES6 grammar summary -- Part I (basic)
Custom view puzzle getcolor r.color The color obtained by colorprimary is incorrect
Esp8266 uses Arduino to connect Alibaba cloud Internet of things