Locking on SQL Server -
we have table on have implemented queuing system using locks selct top 1 ... (with (updlock, readpast)). it's been working until when added column table has fk relationship first table. must add in query uses locks, join on second table.
now after adding column, seem getting frequent locks , timeouts when query run.
is possible related new column? can done resolve?
we using telerik orm run stored procedure.
if you're joining on table you'll want table hints on 1 too. there other transactions hitting other table? if increases chance of deadlock.
for implementing queue in sql server table i've found this answer reference, suggests with (rowlock, readpast, updlock)
. it's possible you're getting lock escalation beyond row, cause issues you're seeing. try adding hint , see if resolves things. ensure have row locking on other queries hitting table or referenced table.
Comments
Post a Comment