sql server - UPDATE Blocking SELECT Of Unrelated Rows -
i have tablea
col1
primary key. running following transaction without committing (for test purposes).
begin transaction update tablea set col3 = 0 col2 = 'aaa'
in meanwhile, run following query , see waits on first transaction complete.
select * tablea col2 = 'bbb'
but following query returns results immediately:
select * tablea col1 = '1'
so thought second query might need read rows have exclusive locks put first transaction in order select rows col2 = 'bbb'
. that's why tried index col2
table seek not necessary did not work either. second query still waits on first transaction.
what should done prevent select
blocking (except use of nolock
).
p.s: transaction isolation level "read committed".
Comments
Post a Comment