`

数据库死锁

 
阅读更多
线程1:
update test1 set column1='' where id='20171013110601';
update test2 set column1='' where id='20171013110601';

线程2:
update test2 set column1='' where id='20171013110601';
update test1 set column1='' where id='20171013110601';


如果两个线程执行更新或者删除的语句顺序不一致,再两个线程并发执行的时候就会产生死锁。

>[Error] Script lines: 2-2 --------------------------
Deadlock found when trying to get lock; try restarting transaction 
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics