首页 > Linux操作系统 > Linux操作系统 > 相同的UPDATE语句引发的死锁
两个事物中相同的UPDATE语句,居然能引发死锁?有兴趣的可以看下:
步骤:
1、分别打开两个db2cmd窗口
2、在窗口1执行:db2 +c "update t1 set c1 =0 where c2 in (1, 2, 3)"
3、在窗口2执行:db2 +c "update t1 set c1 =0 where c2 in (1, 2, 3, 4, 5, 6, 7, 8, 9)"
4、在窗口1执行:db2 +c "update t1 set c1 =0 where c2 in (1, 2, 3, 4, 5, 6, 7, 8, 9)"
死锁了!
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/7690668/viewspace-614567/ ,如需转载,请注明出处,否则将追究法律责任。