Occasionally we need to run updates or inserts of large numbers of records, something which has this nasty habit of taking out locks that will prevent other sessions from updating or inserting in the same tables. Also, if we terminate such an operation, we’ll have to start all over again from the beginning, wasting a lot of time.
Luckily, with Read Committed Snapshot Isolation which is supported by AX, readers will not be blocked by writers, but writes will still be blocked by other writes. Once SQL Server escalates the row-level locks to table-level locks things start to go downhill rather quickly, and as we’re pretty much guaranteed not to have an outage window in which to run the update operation, someone is going to be on the phone soon. Quite soon…
The solution is to break the operation into smaller transactions.
Continue reading “Implementing checkpointing in long-running updates”