Is there a concurrency with UPDATE count=count+1?

前端 未结 4 1811
闹比i
闹比i 2021-01-23 00:42

I wanted to know, will I run into any concurrency problem with this?

This is NOT in a transaction. This code is for Sqlite(prototype), but I plan to use it

相关标签:
4条回答
  • 2021-01-23 01:11

    I may be wrong, but I don't think you would have a problem; the tag_name table I would think would be locked while the UPDATE occurs, so that any other updates waiting to be executed would essentially be queued up rather than occurring concurrently.

    0 讨论(0)
  • 2021-01-23 01:12

    No this shouldn't be a problem. By default the locking mechanism should take care of any concurrency issues in single statements.

    0 讨论(0)
  • 2021-01-23 01:31

    I don't think so, I vaugely remember seeing something like this in a SQL server best practices example from Microsoft.

    0 讨论(0)
  • 2021-01-23 01:35

    not a problem You will have implicit transaction anyway. So it should not be a problem.

    Even if you change TRANSACTION ISOLATION LEVEL, it should work just fine, at least on SQLServer.

    0 讨论(0)
提交回复
热议问题