signumsoftware / framework

Open Source framework for writing data-centric applications using the latest versions of .Net Core, C# (not-nullable), ASP.NET Web API, Typescript (strict), React, D3 and Sql Server or PostgreeSQL
https://www.signumsoftware.com/en/Framework
MIT License
222 stars 84 forks source link

Ignore SqlException if operation was cancelled by user #627

Closed pbeckmannCE closed 8 months ago

olmobrutall commented 8 months ago

Hi pbeckmannCE. Sorry for the delay.

I haven't merged this PR because the code in SqlServerConnector.ReplaceException should replace the exception without depending on the message culture (SQL Server installation).

Why it doesn't work in your case?

pbeckmannCE commented 8 months ago

I found multiple error messages where the first part was either German or English but they always ended with "Operation cancelled by user". So I concluded it might be the same for all languages but you are right, it could also be that the last part depends on the SQL server.

Why it doesn't work? Who knows. All I can say at the momement is, that the users are navigating our application in a normal fashion, which sometimes triggers queries to the database, and then for example they go to another page before the query has finished and we sometimes receive such an exception.

olmobrutall commented 8 months ago

I’ve been checking our apps and we don’t have this exception. Can you give me the stack trace of one of this exceptions?

Alternately you can debug this line https://github.com/signumsoftware/framework/blob/2a477157d5eb9fbc702f2fad02272a1cd38f2837/Signum/Engine/Connection/SqlServerConnector.cs#L372 And check why the SqlException is not being replaced by OperationCanceledException in you environment.

pbeckmannCE commented 8 months ago

Thanks Olmo, I will close this PR then.