Cannot use READPAST in snapshot isolation mode

I have a process that is called from multiple threads that does the following:

  1. Start transaction
  2. Select the unit of work from the worksheet by finding the following line, where IsProcessed=0with the prompts(UPDLOCK, HOLDLOCK, READPAST)
  3. Unit of work handling (stored procedures in C # and SQL)
  4. Make a deal

The idea behind this is that the thread dips into the pool for the "next" part of the work and processes it, and there are locks to ensure that one part of the work will not be processed twice. (order doesn't matter).

All this worked perfectly for several months. Until today, when I realized that, despite the inclusion of snapshot isolation and the default setting at the database level, the actual transaction creation code manually set the isolation level to "ReadCommitted".

I properly changed this to Snapshot and, of course, immediately received the following message:

You can only specify a READPAST lock in READ COMMITTED or REPEATABLE READ

, " " , "" , , , , , , , , . IsProcessed , , , , , NOLOCK, , - .

. , № 3 .

- , ?

+3
1

, ( ). , - , .

+1

Source: https://habr.com/ru/post/1741122/


All Articles