我的数据库是mysql5.7,innodb,已提交隔离级别。我害怕死锁,所以我保持mysql sql语句简单,只有:
insert into ... where ...insert into ... where ... on duplicate key update;一次,永远不要执行多语句insert ... where ...; update ... where ...; where语句具有唯一的索引约束,以确保除select之外只运行一行。我有64个或更多mysql</em
我使用JMeter测试我的程序,不知何故总响应数停止增加,然后我发现在MySQL中有一个死锁。我不明白下面的log是什么意思。似乎transaction(2)拥有一个S锁,并试图拥有同一个表的X锁。这会导致死锁吗?如果是这样,为什么会发生这种情况?-*** (1) TRANSACTION:mysqltables in use 2,