esolução de problemas Timeout SqlExceptions
Tenho um comportamento curioso que estou tendo problemas para descobrir por que está ocorrendo. Estou vendo exceções de tempo limite intermitentes. Tenho certeza de que está relacionado ao volume porque não é reproduzível em nosso ambiente de desenvolvimento. Como solução bandaid, tentei aumentar o tempo limite do comando sql para sessenta segundos, mas, como descobri, isso não parece ajudar. Aqui está a parte estranha: quando eu checo meus logs no processo que está falhando, aqui estão os horários de início e fim:
09/16/2008 16: 21: 49 09/16/2008 16: 22: 19Então, como poderia ser o tempo limite em trinta segundos, quando eu defini o tempo limite do comando para sessenta
Apenas para referência, aqui está a exceção lançada:
System.Data.SqlClient.SqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()
at System.Data.SqlClient.SqlDataReader.get_MetaData()
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
at System.Data.SqlClient.SqlCommand.ExecuteReader()
at SetClear.DataAccess.SqlHelper.ExecuteReader(CommandType commandType, String commandText, SqlParameter[] commandArgs)