-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Treat SQL Server Error Number 1222 as Transient (Lock request time out period exceeded) #31724
Comments
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 dotnet#31724
There are two other error numbers inside the SqlConfigurableRetryFactory class which aren't treated as transient by Entity Framework:
I didn't include these numbers in this PR explicitly because the are not listed in sys.messages, but they are included in official Microsoft documentation, so perhaps it makes sense to broaden this PR to include those two as well? |
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
You can submit a separate PR for this |
1 similar comment
You can submit a separate PR for this |
- [Microsoft Documentation on 42108](https://learn.microsoft.com/en-us/sql/relational-databases/errors-events/mssqlserver-42108-database-engine-error?view=sql-server-2017) - [Microsoft Documentation on 42109](https://learn.microsoft.com/en-us/sql/relational-databases/errors-events/mssqlserver-42109-database-engine-error?view=sql-server-ver16) Fixes dotnet#31724 (these are the additional error codes referenced in this conversation)
The SQL Server exception number 1222 (Lock request time out period exceeded) should be treated as a transient exception.
sys.messages
lists the error text for 1222 as "Lock request time out period exceeded."Adding the error number to the giant case statement inside SqlServerTransientExceptionDetector.cs should be enough to satisfy this request.
The text was updated successfully, but these errors were encountered: