Skip to content

Commit

Permalink
Treat Sql Error Number 1222 as Transient (#31725)
Browse files Browse the repository at this point in the history
Error number 1222 is defined as

> Lock request time out period exceeded

And official Microsoft recommendation is to retry the transaction after it has been aborted [Source](https://learn.microsoft.com/en-us/sql/relational-databases/errors-events/mssqlserver-1222-database-engine-error)

Fixes #31724
  • Loading branch information
freakingawesome authored Sep 14, 2023
1 parent a4db3b7 commit 301b01b
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,9 @@ public static bool ShouldRetryOn(Exception? ex)
// SQL Error Code: 1232
// Failed to acquire lock with lock manager service, it could be due to many reasons including transient service failure.
case 1232:
// SQL Error Code: 1222
// Lock request time out period exceeded.
case 1222:
// SQL Error Code: 1221
// The Database Engine is attempting to release a group of locks that are not currently held by the transaction.
// Retry the transaction. If the problem persists, contact your support provider.
Expand Down

0 comments on commit 301b01b

Please sign in to comment.