Locking

Tag: locking

Testing an Insert for Race Conditions with Ostress.exe

Testing an Insert for Race Conditions with Ostress.exe

Whenever we have multiple sessions modifying data, things get tricky. When we have a pattern of “check if the data exists and then do a thing,” multiple sessions get even more complicated.

Continue reading

The Case of the Blocking Merge Statement (LCK_M_RS_U locks)

The Case of the Blocking Merge Statement (LCK_M_RS_U locks)

Recently I got a fun question about an “upsert” pattern as a “Dear SQL DBA” question. The question is about TSQL, so it lent itself to being answered in a blog post where I can show repro code and screenshots.

Continue reading