Select the top 1 @ Amount=Amount from [Sells] where ID=@ ID and key=1 order by ID Desc
Business logic (processing is more complex, is about 0.3 seconds)
- update field
The update sells the set key=1 where id=@ id
Commit Tran
Due to the large concurrent, there has been no wait for change value, other users have read the record. Cause business processing error.
CodePudding user response:
Sells can be locked in the transaction, not to read, but this may affect the overall efficiency