重启数据库服务器后数据库无法连接的解决方法

我们的Workflow Enging所用的数据库是安装在流程服务器上的。今天该服务器有问题,请系统管理员重启。重启后发现了以下问题:

经检查出问题的都出在和流程数据库交互的地方。

使用SQL Server的监视器没有发现死锁,使用SQL Server的管理器也可以正常连接。

最后发现IIS对该服务器的连接数太多造成的。当重启流程服务器时,IIS应用程序池一直在试图连接该数据库,因为连接不上所以都Hold在那儿了。将IIS的应用程序池重新回收一下后问题解决。

Server Error in '/' Application.


ExecuteReader requires an open and available Connection. The connection's current state is closed.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: ExecuteReader requires an open and available Connection. The connection's current state is closed.

Source Error:

 

Line 1:  <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PUR_Material_Query.aspx.cs" Inherits="GraceSemi.NET.Web.Pages.PUR.Common.PUR_Material_Query" %>

Line 2:  <%@ Register assembly="Anthem" namespace="Anthem" tagprefix="anthem" %>

Line 3:  <%@ Register src="../SpareParts/PUR_SparePartsMenu.ascx" tagname="PUR_SparePartsMenu" tagprefix="uc1" %>


Source File: c:\inetpub\wwwroot\GraceSemi\Pages\PUR\Common\PUR_Material_Query.aspx    Line: 1

Stack Trace:

 

[InvalidOperationException: ExecuteReader requires an open and available Connection. The connection's current state is closed.]

   System.Data.SqlClient.SqlConnection.GetOpenConnection(String method) +6317475

   System.Data.SqlClient.SqlConnection.ValidateConnectionForExecute(String method, SqlCommand command) +13

   System.Data.SqlClient.SqlCommand.ValidateCommand(String method, Boolean async) +271

   System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +138

   System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) +28

   System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) +256

   System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior) +19

   System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader() +23

   GraceSemi.NET.Data.Common.ConnectionHandler.ExecuteReader(Command cmd) +170

   GraceSemi.NET.Data.Common.ConnectionContext.ExecuteReader(Command cmd) +82

   GraceSemi.NET.Data.Common.ConnectionContext.List(Type type, Command cmd, Region region) +594

   GraceSemi.NET.Data.Common.ConnectionContext.ListFirst(Type type, Command cmd) +90

   GraceSemi.NET.Data.Common.ConnectionContext.ListFirst(Command cmd) +111

   GraceSemi.NET.Data.Common.EntityBase.OnListFirst(IConnectinContext cc, String from, Expression expression, String orderby, String groupby) +586

   GraceSemi.NET.Data.Common.EntityBase.ExOnListFirst(IConnectinContext cc, String from, Expression expression, String orderby, String groupby) +164

   GraceSemi.NET.Data.Common.Expression.ListFirst(IConnectinContext cc, String orderby) +348

   GraceSemi.NET.Data.Common.Expression.ListFirst(IConnectinContext cc) +131

   GraceSemi.NET.Business.t_User.set_UserName(String value) +244

   GraceSemi.NET.TaskPage.SSO(String UserName) +144

   GraceSemi.NET.TaskPage.InitializeCulture() +3642

   ASP.pages_pur_common_pur_material_query_aspx.__BuildControlTree(pages_pur_common_pur_material_query_aspx __ctrl) in c:\inetpub\wwwroot\GraceSemi\Pages\PUR\Common\PUR_Material_Query.aspx:1

   ASP.pages_pur_common_pur_material_query_aspx.FrameworkInitialize() in c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\3a66716a\f24c2056\App_Web_0jitdpta.3.cs:0

   System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +72

   System.Web.UI.Page.ProcessRequest() +119

   System.Web.UI.Page.ProcessRequest(HttpContext context) +167

   ASP.pages_pur_common_pur_material_query_aspx.ProcessRequest(HttpContext context) in c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\3a66716a\f24c2056\App_Web_0jitdpta.3.cs:0

   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +597

   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +266

转载于:https://www.cnblogs.com/dragonwlb/archive/2012/06/11/2544705.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值