按照死锁的定义,在这种情况下会发生死锁。
In this situation, the deadlock occurred according to the deadlock definition.
死锁也会发生在单独的线程中。
经验告诉我们,这需要2条sql语句,并且UPDATE应该在SELECT语句之前执行;否则,当并发增多时,可能会发生死锁。
Conventional wisdom states that this requires 2 SQL statements, and that the UPDATE ought to be done prior to the SELECT; otherwise deadlocks may occur as concurrency increases.
应用推荐