Mysql DB是我们的应用程序数据库。在我的java代码中,我有一个事务的多个更新。一次事务中多次更新是否会导致死锁?
t = session.beginTransaction();
q1.executeUpdate();
q2.executeUpdate();
q3.executeUpdate();
t.commit();
注意Q1和Q3更新同桌Q1就像
update table1 set col0 = 'A' where id = 'myId'
和Q3是
update table1 set col0 = 'B' where col0 = 'C'
。
请问这会造成死锁的麻烦吗?如果是这样,我能在脚本中看到“死锁”异常(我正在使用hibernate实现上述功能)。提前致谢。