Insert Concurrency Issue - Multithreaded Environment

前端 未结 4 1643
有刺的猬
有刺的猬 2021-02-09 18:04

I have an issue that the same stored procedure is being invoked at exactly the same time with exactly the same paramenters.

The purpose of the stored procedure is to fet

4条回答
  •  暗喜
    暗喜 (楼主)
    2021-02-09 18:38

    Not sure if SQL Server has it. But in MySQL and in oracle you can get write lock while doing a select using for update syntax.

    select * 
    from table 
    for update
    

    Since other threads also need write lock while doing select, they will wait till first thread completes the transaction.

提交回复
热议问题