Home  >  Q&A  >  body text

mysql - Since innodb has gap locks at the RR isolation level, why do two transactions still produce deadlocks due to different locking orders? ?

Deadlock is caused by multiple transactions competing for the same resource. Whether it is two SQL statements in two transactions, the locking order of the resources being operated is different, or the locking order of the resources operated by one SQL statement in the two transactions is different. Why is the gap lock not locking in the scope, thus suspending another transaction's request for the resource?

ringa_leeringa_lee2710 days ago694

reply all(1)I'll reply

  • 某草草

    某草草2017-05-18 10:56:38

    I think specific issues should be dealt with in detail. Let’s take a detailed look at your two SQLs and then analyze them in detail

    reply
    0
  • Cancelreply