BLUE
Profile banner
P
Peter Åkerlund
@djpakerlund.bsky.social
Database professional, Sci-Fi fan and over all skeptic!
34 followers141 following35 posts
Pdjpakerlund.bsky.social

Any ideas how two sessions running the same MERGE stagement can dead lock each other when usign RCSI? #sqlhelp Yes, I know you shouldn't use merge but you ahve what you have.

2

DHdhma.ch

Is there anything else than the MERGE statement in your transaction, like a DDL statement? For what it's worth, I ran into a similar issue, though not on RCSI but with a HOLDLOCK hint, which forced serializable isolation.

How MERGE on two different rows can still deadlock you
How MERGE on two different rows can still deadlock you

I recently ran into a curious deadlock issue. I have a process that performs a lot of updates in a "state" table using multiple, concurrent connections. The business logic in the application guarantee...

1
DDdarlingdata.bsky.social

rcsi only helps with reads, not with writes. write queries can still deadlock for a variety of reasons when using it.

1
Profile banner
P
Peter Åkerlund
@djpakerlund.bsky.social
Database professional, Sci-Fi fan and over all skeptic!
34 followers141 following35 posts