0

As part of a new feature, some code that calls the following method was added

try
{
    using (var context = new TRContext())
    {
        var query = from option in context.Option
                    where option.package == package && option.type== type
                    select option;

        return query.DefaultIfEmpty(null).First();
    }
}
catch (Exception ex)
{
    Logger.Error($"Failed to get Option by package='{package}' and type='{type}'", ex);
    return null;
}

This is called before as part of other functionality(and works fine), then when fetching it again, I get this error:

System.Data.Entity.Core.EntityException: The underlying provider failed on Open.

System.Data.SqlClient.SqlException: Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding

I've tried

or having context.Databae.Connection.Open() but get other errors.

What could have led to this ? How could I fix it?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Daniel
  • 335
  • 1
  • 5
  • 13

0 Answers0