Home > database >  The use of SQL server to ask with nolock
The use of SQL server to ask with nolock

Time:02-17

Basic business is like this... I am now doing a system, sometimes with rob votes, concurrency is bigger, so this time, the system occurs behind lots of deadlock...


My watch is probably it is five in simple terms, can be simply as A, B, C, D, E, and then some query stored procedure (1), (2), (3), then there is the main submission stored procedures (1)

In a large quantity of concurrent, access to the stored procedure (1), so will cause the storage cause deadlock,

But now I'm optimization is (1), (2), (3) the stored query, I on these storage, all the query A, B, C, D, E table under the select, are used with nolock...

Now I want to do is to show the customer, don't happen jam, these tables are allowed to have dirty data, so you can use with nolock...

As long as submitted by the stored procedure (1) need not with nolock can guarantee the accuracy of the data,,


But I now the problem is that even if (1), (2), (3) used with nolock, but when a user calls these storage, will still be submitted to the access time out... Or
Transaction (process ID % 1! And another process has been a deadlock in the resource {% 2! }, and this transaction has been selected victim fault lock similar mistake

This I'm a little don't understand, because I these queries is not transaction, but also opened up with nolock, so I think (1), (2), (3) the query execution time storage
Will not happen this mistake, if it is submitted by the storage (1) an error, I understand, but can't understand (1), (2), (3) executes an error,
  • Related