我们的网站经常down了,重启服务器后就好了(服务器用的是阿里的)。浏览网页时也常出现下面的报错信息,再重新刷新页面又正常了。已经把服务器升级了,也没解决问题,网站down掉时查看服务器的CPU、内存的使用率都是正常的,访问量也不高。实在找不到原因,就只能来求助了,有碰到过类似问题的兄弟吗?下面是页面的报错信息:
“/”应用程序中的服务器错误。
执行该命令需要打开的且可用的连接。连接的当前状态为 已断开。
说明: 执行当前 Web 请求期间,出现未经处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。
异常详细信息: System.InvalidOperationException: 执行该命令需要打开的且可用的连接。连接的当前状态为 已断开。
源错误:
执行当前 Web 请求期间生成了未经处理的异常。可以使用下面的异常堆栈跟踪信息确定有关异常原因和发生位置的信息。
堆栈跟踪:
[InvalidOperationException: 执行该命令需要打开的且可用的连接。连接的当前状态为 已断开。]
System.Data.Objects.ObjectContext.EnsureConnection() +8597313
System.Data.Objects.ObjectContext.CreateFunctionObjectResult(EntityCommand entityCommand, EntitySet entitySet, EdmType edmType, MergeOption mergeOption) +97 System.Data.Objects.ObjectContext.ExecuteFunction(String functionName, MergeOption mergeOption, ObjectParameter[] parameters) +218 Test.Site.DataSource.Data.MemberRepository.MemberInfo_Load_p(Byte loadType, String account, Byte socialType, String para, Int32 memberId, Int32 relatedMemberId) in d:\Test\SourceCode\VS\Test\Data\Repositories\IMemberRepository.cs:123 Test.Site.DataSource.Data.MemberRepository.GetMemberInfo(Byte loadType, Int32 memberId, Int32 relatedMemberId) in d:\Test\SourceCode\VS\Test\Data\Repositories\IMemberRepository.cs:101 Test.Site.Services.Managers.MemberManager.GetMemberInfo(Int32 memberId) in d:\Test\SourceCode\VS\Test\Business\Managers\MemberManager.cs:129 Test.Site.Services.CommonService.GetMemberInfo(Int32 memberId) in d:\Test\SourceCode\VS\Test\Business\Service\CommonService.cs:239 Test.Controllers.HomeController.Index() in d:\Test\SourceCode\VS\Test\TestUI\Controllers\HomeController.cs:83 lambda_method(Closure , ControllerBase , Object[] ) +62 System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +17 System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary2 parameters) +188 System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary2 parameters) +27 System.Web.Mvc.Async.<>c__DisplayClass42.b__41() +28 System.Web.Mvc.Async.<>c__DisplayClass81.b__7(IAsyncResult _) +12 System.Web.Mvc.Async.WrappedAsyncResult1.End() +50 System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) +29 System.Web.Mvc.Async.<>c__DisplayClass39.b__33() +59 System.Web.Mvc.Async.<>c__DisplayClass4f.b__49() +240 System.Web.Mvc.Async.<>c__DisplayClass37.b__36(IAsyncResult asyncResult) +12 System.Web.Mvc.Async.WrappedAsyncResult1.End() +50 System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult) +31 System.Web.Mvc.Async.<>c__DisplayClass2a.b__20() +23 System.Web.Mvc.Async.<>c__DisplayClass25.b__22(IAsyncResult asyncResult) +128 System.Web.Mvc.Async.WrappedAsyncResult1.End() +50 System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +26 System.Web.Mvc.<>c__DisplayClass1d.b__18(IAsyncResult asyncResult) +14 System.Web.Mvc.Async.<>c__DisplayClass4.b__3(IAsyncResult ar) +25 System.Web.Mvc.Async.WrappedAsyncResult1.End() +55 System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +41 System.Web.Mvc.Async.<>c__DisplayClass4.b__3(IAsyncResult ar) +25 System.Web.Mvc.Async.WrappedAsyncResult1.End() +55 System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +28 System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult) +10 System.Web.Mvc.<>c__DisplayClass8.b__3(IAsyncResult asyncResult) +28 System.Web.Mvc.Async.<>c__DisplayClass4.b__3(IAsyncResult ar) +25 System.Web.Mvc.Async.WrappedAsyncResult`1.End() +55 System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +30 System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +8967053 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +184
版本信息: Microsoft .NET Framework 版本:4.0.30319; ASP.NET 版本:4.0.30319.272