0
votes

I am testing my application for multiple users through gatling performance tool.When it hits login method for simultaneous users some users logged in successfully but for some users i am getting "The underlying provider failed on Open." error. Below is the stack trace:

at System.Data.EntityClient.EntityConnection.OpenStoreConnectionIf(Boolean openCondition, DbConnection storeConnectionToOpen, DbConnection originalConnection, String exceptionCode, String attemptedOperation, Boolean& closeStoreConnectionOnFailure)

at System.Data.EntityClient.EntityConnection.Open() at System.Data.Objects.ObjectContext.EnsureConnection() at System.Data.Objects.ObjectContext.CreateFunctionObjectResult[TElement](EntityCommand entityCommand, ReadOnlyMetadataCollection1 entitySets, EdmType[] edmTypes, MergeOption mergeOption) at System.Data.Objects.ObjectContext.ExecuteFunction[TElement](String functionName, MergeOption mergeOption, ObjectParameter[] parameters) at System.Data.Objects.ObjectContext.ExecuteFunction[TElement](String functionName, ObjectParameter[] parameters) at Pals.Entities.PalsEntities.sp_FetchVinStatusForAdminCountModifiedAsn(String dealerid, String oemid, String terminalId, Nullable1 fromDate, Nullable1 toDate, String onHoldDisplayFlag) at Portal.Business.Implementation.VinStatusCountAdmin.&lt;&gt;c__DisplayClass1.&lt;FetchVinStatusForAdminCountAsn&gt;b__0() at Microsoft.Practices.TransientFaultHandling.RetryPolicy.ExecuteAction[TResult](Func1 func) at Portal.Business.Implementation.VinStatusCountAdmin.FetchVinStatusForAdminCountAsn(String dealerId, String oemId, String terminalId, DateTime fromDate, DateTime toDate, String onHoldDisplyaFlag) at Portal.Business.Managers.DashBoardManager.GetVinStatusCountForAdmin(String dealerId, String oemId, String terminalId, DateTime fromDate, DateTime toDate, String boardStatus, String onHoldDisplayFlag) at Portal.Business.Managers.DashBoardManager.GetDashBoardParallel(SimpleSearch objdao, String boardStatus) at Pals.Web.Controllers.SearchController.LoadDashBoardParallel(String dealerId, String shipperId, String terminalId, String fromDate, String toDate, String boardStatus) at lambda_method(Closure , ControllerBase , Object[] ) at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary2 parameters) at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary2 parameters) at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass15.<InvokeActionMethodWithFilters>b__12() at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func1 continuation) at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters(ControllerContext controllerContext, IList1 filters, ActionDescriptor actionDescriptor, IDictionary`2 parameters) at System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName)

I am using entityframework in my application.

1
Is there an inner exception? If so, what is it?Brendan Green
@BrendanGreen i am getting "The underlying provider failed on Open." in inner exception also.Mrityunjay
Is there an inner inner exception? In every case I've seen and read about, there is always a more detailed exception inside.Steve
@Steve.i just enabled exception detail on error page and through gatling i am getting those responses.I will dig into this at code level and post if got detailed inner exception.Mrityunjay

1 Answers

0
votes

(Assuming you're using EF6)

Have you specified the SqlAzureExecutionStrategy in your EF configuration?

If not (or if you don't know what I'm talking about) then you need to create a class in the same project as your DbContext) that inherits DbConfiguration, and in its constructor, call the SetExecutionStrategy protected method, like this:

using System.Data.Entity; 
using System.Data.Entity.Infrastructure; 
using System.Data.Entity.SqlServer; 

namespace MyNamespace 
{ 
    public class MyConfiguration : DbConfiguration 
    { 
        public MyConfiguration() 
        { 
            SetExecutionStrategy("System.Data.SqlClient", () => new SqlAzureExecutionStrategy()); 
        } 
    } 
}

// from http://msdn.microsoft.com/en-us/library/dn456835.aspx

You can play with the configuration of the SqlAzureExecutionStrategy to set things like retry limits, timeouts and so on.