我有一个Windows服务,它连续每10秒钟查询SQL Server数据库表,并且我也有一个网站,它也在25秒后查询同一个数据库表。Windows服务SQL超时异常
过了一段时间我得到异常 - server timeout exception has occurred
。我经历了堆栈溢出网站,并对SQL配置设置进行了更改,但仍得到相同的异常。该怎么办?
堆栈跟踪
在System.Data.SqlClient.SqlConnection.OnError(SQLEXCEPTION 例外,布尔breakConnection)在 System.Data.SqlClient.SqlInternalConnection.OnError(SQLEXCEPTION 例外,布尔breakConnection )在 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()在 System.Data.SqlClient.TdsParser.Run(runBehavior runBehavior, 的SqlCommand cmdHandler,SqlDataReader的数据流, BulkCopySimpleResultSet散装CopyHandler,TdsParserStateObject stateObj)在System.Data.SqlClient.SqlDataReader.ConsumeMetaData() 在System.Data.SqlClient.SqlDataReader.get_MetaData()在 System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader的DS, RunBehavior runBehavior,串resetOptionsString)在 System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(的CommandBehavior cmdBehavior,runBehavior runBehavior,布尔returnStream,布尔 异步)在 System.Data.SqlClient.SqlCommand.RunExecuteReader(的CommandBehavior cmdBehavior,runBehavior runBehavior,布尔returnStream ,字符串 方法,DbAsyncResult结果)在 System.Data.SqlClient.SqlCommand.RunExecuteReader(C ommandBehavior cmdBehavior,RunBehavior runBehavior,布尔returnStream,字符串 方法)在 System.Data.SqlClient.SqlCommand.ExecuteReader(的CommandBehavior 行为,字符串方法)在 System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(的CommandBehavior 行为)在 System.Data.Common.DbCommand.ExecuteReader(的CommandBehavior行为)
处 Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteReader Microsoft.Practices.EnterpriseLibrary.Data.Database.DoExecuteReader(的DbCommand 命令,的CommandBehavior cmdBehavior) (DbCommand command)at Microsoft。 Practices.EnterpriseLibrary.Data.CommandAccessor1.<Execute>d__0.MoveNext() at System.Collections.Generic.List
1..ctor(IEnumerable的1 collection)
1源) 在System.Runtime.Remoting.Messaging.Message.Dispatch(对象目标,布尔fExecuteInContext)在 System.Runtime.Remoting.Messaging.StackBuilderSink。 SyncProcessMessage(IMessage msg,Int32 methodPtr,Boolean fExecuteInContext)
at System.Linq.Enumerable.ToList[TSource](IEnumerable
我们展示了完整的堆栈跟踪和异常消息,以从...开始。 –
您需要确定发生的情况。它是连接,它是一个事务,命令等使用一些日志记录来确定错误的位置并发布异常跟踪。这应该给你一些线索,以了解需要调整的东西。就目前而言,你的问题就像阅读。 –