J'ai un comportement curieux que j'ai du mal à comprendre pourquoi cela se produit. Je vois des exceptions de délai d'attente intermittent. Je suis sûr que c'est lié au volume parce que ce n'est pas reproductible dans notre environnement de développement. En tant que solution bandaid, j'ai essayé d'augmenter le délai d'attente de la commande sql à soixante secondes, mais comme je l'ai constaté, cela ne semble pas aider. Voici la partie étrange, quand je vérifie mes journaux sur le processus qui a échoué, voici les heures de début et de fin:Dépannage Timeout SqlExceptions
- 09/16/2008 16:21:49
- 09/16/2008 16 : 22: 19
Alors, comment cela pourrait-il être que le délai expire en trente secondes lorsque j'ai mis la commande timeout à soixante ??
Juste pour référence, voici l'exception d'être jeté:
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)
Il s'est avéré que nous avions juste besoin d'ajouter un nouvel index :-) –