Hi
I am using nopcommerce 4.2 and local database and recently having many Database Connection Resiliency exception as follow:
"An exception has been raised that is likely due to a transient failure. Consider enabling transient error resiliency by adding 'EnableRetryOnFailure()' to the 'UseSqlServer' call.."
where this exception occurred in different cases including order placing, updating product, .. etc
I read this is EF core issue and one of the suggestion to add the following code in Startup.cs class in ConfigureServices method:
public void ConfigureServices(IServiceCollection services)
{
services.AddDbContext<PicnicContext>(
options => options.UseSqlServer(
"<connection string>",
providerOptions => providerOptions.EnableRetryOnFailure()));
}
source: https://docs.microsoft.com/en-us/ef/core/miscellaneous/connection-resiliency
BUT, I really don't know which context to use instead of <PicnicContext> or if there is any other better solution.
Thanks