加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

如何调查ASP.net应用程序上的SQL Server超时错误?

发布时间:2020-12-16 09:51:13 所属栏目:asp.Net 来源:网络整理
导读:我们在NopCommerce – ASP.net MVC3 Web应用程序上面临服务器超时错误. 当我们结束sql进程时,错误只会重新发生.在结束时它开始工作正常一段时间然后再次开始发生. 这种情况仅在过去的几天发生,之前它工作正常.请注意,其代码中未进行任何重大更新. 我们一无所
我们在NopCommerce – ASP.net MVC3 Web应用程序上面临服务器超时错误.

当我们结束sql进程时,错误只会重新发生.在结束时它开始工作正常一段时间然后再次开始发生.

这种情况仅在过去的几天发生,之前它工作正常.请注意,其代码中未进行任何重大更新.

我们一无所知,可能是什么问题以及如何调查和修复它?它是连接池相关的问题还是什么?

这是堆栈跟踪:

Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
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.Data.SqlClient.SqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[SqlException (0x80131904): Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.]
System.Data.SqlClient.SqlConnection.OnError(SqlException exception,Boolean breakConnection) +296
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning() +415
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior,SqlCommand cmdHandler,SqlDataReader dataStream,BulkCopySimpleResultSet bulkCopyHandler,TdsParserStateObject stateObj) +2657
System.Data.SqlClient.SqlDataReader.ConsumeMetaData() +88
System.Data.SqlClient.SqlDataReader.get_MetaData() +114
System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds,RunBehavior runBehavior,String resetOptionsString) +505
System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior,Boolean returnStream,Boolean async) +1896
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior,String method,DbAsyncResult result) +480
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior,String method) +28
System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior,String method) +854
System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior) +22
System.Data.Mapping.Update.Internal.DynamicUpdateCommand.Execute(UpdateTranslator translator,EntityConnection connection,Dictionary2 identifierValues,List1 generatedValues) +269
System.Data.Mapping.Update.Internal.UpdateTranslator.Update(IEntityStateManager stateManager,IEntityAdapter adapter) +528

解决方法

@Dharmik Bhandari,可能有几个问题.尝试以下方法

>增加池大小> set CommandTimeOut = 0(无限)>设置ConnectionTimeOut = 0(无限)>数据库功能结束后立即释放连接资源

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读