SQL queries causing deadlock errors -
there update query causes deadlock errors don't know why. there (rowlock, updlock) hint used in update query still gives deadlock error.
sample query:
update table (rowlock, updlock) set a.column1 = value
this same query used in several stored procedures may called simultaneously. since lock specified should still causes deadlock
deadlock occurs when 2 or more tasks permanently block each other each task having lock on resource other tasks trying lock.
since explicitly specifying with (rowlock, updlock)
add lock upon transaction. eventually, when 1 transaction being executed, places lock on table. if transaction wants access same record, have wait until previous transaction finishes , remove lock proceed.
using with nolock
enables bypass locks in case of update, risky. more so, mentioned, several update can executed simultaneously.
in case, seems locks culprit. however, locks not source of deadlocks. might memory issues or thread execution also. link might identify real cause of deadlock.
Comments
Post a Comment