This is an extension to Is row level forced locking possible in SQL Server? . Here is a usage example
I have a table of accounts with account numbers, balances, etc. This table is used by many applications. It is possible that by changing an account, someone else will modify another account. So the expected behavior is that I blocked my account (ROW) and another use will block it (another ROW).
But SQL Server 2008 R2 increases this lock per page / table, and the second user receives a timeout exception. I tried all the solutions mentioned in the question mentioned, but nothing works.
How to force SQL Server to lock only row-level locking OR how can I change this model so that it works with page / table locking?
EDIT The update is for one record via PK, and it is indexed, so only ONE ROW is updated / blocked, and the process takes no more than a minute
Edit Now it looks weird. I use the ORM library for DAL, which opens several connections, and I asked a question about their support. But for testing purposes, I opened two sessions in the query tool and did the following
Session
Request in session # 2 times! Queries for other COL_1 values ββwork fine. Now it looks like SELECT is locked for a session if the same record is in edit mode in another session.
Although Oracle supports selecting a row (with default parameters / without keywords), while it is modified by another session, SQL Server does not (with default parameters / without keywords), so the problem seems to be related to the library.
sql-server rowlocking
bjan May 18 '12 at 7:28 2012-05-18 07:28
source share