Does “select for update” prevent other connections inserting when the row is not present

前端 未结 5 1081
轮回少年
轮回少年 2020-12-30 21:24

I\'m interested in whether a select for update query will lock a non-existent row.

e.g.

Table FooBar with two columns, foo and bar, foo has a un

5条回答
  •  臣服心动
    2020-12-30 21:59

    I wrote a detailed analysis of this thing on SQL Server: Developing Modifications that Survive Concurrency

    Anyway, you need to use SERIALIZABLE isolation level, and you really need to stress test.

提交回复
热议问题