mysql 为何insert的时候会有lock wait timeout 异常
执行单元测试(mvn clean test)时偶尔会遇到下面的异常信息
org.springframework.dao.CannotAcquireLockException:
### Error updating database. Cause: java.sql.SQLException: Lock wait timeout exceeded; try restarting transaction
### The error may involve com.foo.dao.mapper.TestMapper.insertSuccesfulPaymentOrder-Inline
### The error occurred while setting parameters
### SQL: insert into order(order_seq,note,user_id,product_id, pay_status) values(uuid(),'',?,?,1)
### Cause: java.sql.SQLException: Lock wait timeout exceeded; try restarting transaction
; SQL []; Lock wait timeout exceeded; try restarting transaction; nested exception is java.sql.SQLException: Lock wait timeout exceeded; try restarting transaction
但是像这样的错误 不应该只是update才会有吗? 见官方文档说明
A transaction that tries to access a row that is locked by another InnoDB transaction waits at most this many seconds for write access to the row before issuing the following error:
ERROR 1205 (HY000): Lock wait timeout exceeded; try restarting transaction
但我明明是insert啊。 并且还只是偶尔会有这种情况, 且稍后就正常了。
所以不明白到底是怎么回事? 怎么模拟这种情况呢?
相关阅读:
border-radius失效有哪些原因呢?
我使用Leaks测试内存泄漏时,报了一个黄色的警告,请大神帮忙分析分析!
请求为.do的网站,爬虫会检索吗?目前网站未做静态化处理,如何SEO优化
这段代码中iframe与setTimeout是如何实现判断APP是否唤起的?
如何将android studio设置复位,将设置恢复到初始化?
java web开发中jsp表单中post方式提交的数据controller如何接收
求常用网吧计费系统的进程名
自定义tabBar,点击不能变换select状态
服务器CPU性能测试的工具?
定制虚拟机的内存和CPU频率
beego新版本的分页求助?
rtmp在线直接播放不了
元素在旋转后,perspective-origin还是原来的面的呢还是不变呢?
Activemq 如何配置多个queue队列
如何算相互关注?
docker 和 宿主机公用一套根目录
requirejs有没有像seajs的paths那样的功能
有一li元素其中有中文和英文,怎么分别设置他们的字体样式呢?
请教bootstrap轮播图问题。
如何批量运行一些目录里的gruntfile文件?