The wait operation ended with a Win32Exception (0x80004005): the wait operation was suspended by azure

The following error occurs when retrieving large amounts of data from sql azure. I am already applying transient error handling, but still getting this error

Description: An unhandled exception occurred during the execution of the current web request. View the stack trace for more information about the error and its occurrence in the code.

Exception Details: System.ComponentModel.Win32Exception: Timeout

Source Error:

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

Stack trace:

[Win32Exception (0x80004005): timeout waiting time]

[SqlException (0x80131904): timed out. The wait period expires before the operation is completed or the server does not respond.] System.Data.SqlClient.SqlConnection.OnError (SqlException exception exception, logical connection disconnection, action1 wrapCloseInAction) +1789270 System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction) +5340622 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning (TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) +244 System.Data.SqlClient.TdsParser.TryRun (RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj , Boolean & dataReady) +1691 System.Data.SqlClient.SqlCommand.FinishExecuteReader (SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +275 System.Data.SqlClient.SqlCommand.RunExecuteReaderTaviorBehhhh CommandBehhh CommandRebhhh CommandRebhhh CommandBehhh CommandRebhhhh CommandBehhhhh Int32 timeout, task and task, logical name asyncWrite, SqlDataReader ds) +1421 System.Data.SqlClient.SqlCommand.RunExecuteReader (CommandBehavior cmdBehavior, RunBehavior runBehavior,Boolean returnStream, String method, TaskCompletionSource1 completion, Int32 timeout, Task& task, Boolean asyncWrite) +177 System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource1 termination, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite) +208 System.Data.SqlClient.SqlCommand.ExecuteNonQuery () +163 System.Web.SessionState.SqlSessionStateStore.SqlExecuteNonQueryWithRetmodemdrerymderymand 98

[HttpException (0x80004005): SQL Server.]  System.Web.SessionState.SqlSessionStateStore.ThrowSqlConnectionException(SqlConnection conn, Exception e) +235  System.Web.SessionState.SqlSessionStateStore.SqlExecuteNonQueryWithRetry(SqlCommand cmd, Boolean ignoreInsertPKException, String id) +390  System.Web.SessionState.SqlSessionStateStore.SetAndReleaseItemExclusive( HttpContext, , SessionStateStoreData, Object lockId, Boolean newItem) +589  System.Web.SessionState.SessionStateModule.OnReleaseState( , EventArgs eventArgs) +565  System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +136  System.Web.HttpApplication.ExecuteStep( IExecutionStep, Boolean & ) +69

: Microsoft.NET Framework : 4.0.30319; ASP.NET: 4.0.30319.34009

http://i.stack.imgur.com/8BloW.png

-1
3

SqlClient.SqlCommand CommandTimeout. - 30 . .

0

- , . , , , , 2 . , .

// I'm populating an ADO.Net DataTable for this demo but populate whatever object you'd like
DataTable DtFromSQL = new DataTable();
SqlConnection myConnection = new SqlConnection("ConnectionString");
myConnection.Open();
SqlDataReader myReader = null;
SqlCommand myCommand = new SqlCommand("enter some SQL query here", myConnection);
// A CommandTimeout Value of 0 turns the timout off, otherwise you can set it to some value in seconds
myCommand.CommandTimeout = 0;  
myReader = myCommand.ExecuteReader();
DtFromSQL.Load(myReader8);
myConnection.Close();
DtFromSQL;
0

- : - . , , .

: System.ComponentModel.Win32Exception:

:

653:} 654:
655: base.ExecuteFunction("GetProduct", subCategoryIdParameter, modeParameter); 656:} 657:

: h:\root\home\dtrack-001\www\dtrack\App_Code\DTrack.Designer.cs : 655

:

[Win32Exception (0x80004005): - ]

[SqlException (0x80131904): . , .] System.Data.SqlClient.SqlConnection.OnError ( SqlException, , , 1 wrapCloseInAction) +2555926 System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action 1 wrapCloseInAction) +5959200 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, asyncClose) +285 System.Data.SqlClient.TdsParser.TryRun(runBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader DATASTREAM, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, & dataReady) +4169 System.Data.SqlClient.SqlDataReader.TryConsumeMetaData() +58 System.Data.SqlClient.SqlDataReader.get_MetaData() +89 System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, resetOptionsString, isInternal, forDe scribeParameterEncryption, shouldCacheForAlwaysEncrypted) +430 System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, returnStream, , Int32 -, , asyncWrite, inRetry, SqlDataReader DS, describeParameterEncryptionRequest) [CN07 ] System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, returnStream, String, TaskCompletionSource'1, Int32, Task & task, Boolean & usedCache. SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, runBehavior runBehavior, returnStream, String) +64 System.Data.SqlClient.SqlCommand.ExecuteReader ( CommandBehavior, String) +240 System.Data.SqlClient.SqlCommand.ExecuteDbDataReader( CommandBehavior) +41 System.Data.Common.DbCommand.ExecuteReader(CommandBe ) +12 System.Data.EntityClient.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior) +435

[EntityCommandExecutionException: . . .] System.Data.EntityClient.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior) +500 System.Data.Objects.ObjectContext.CreateFunctionObjectResult 1 entitySets, EdmType[] edmTypes, MergeOption mergeOption) +145 System.Data.Objects.ObjectContext.ExecuteFunction(String functionName, MergeOption mergeOption, ObjectParameter[] parameters) +310 System.Data.Objects.ObjectContext.ExecuteFunction(String functionName, ObjectParameter[] parameters) +57 PointSaleDBModel.DTrack.GetProduct(Nullable 1 subCategoryId, ) h:\root\home\dtrack-001\www\dtrack\App_Code\DTrack.Designer.cs: 655 ProductRepository.GetProducts ( , Int32 categoryId) h :\root\home\dtrack-001\www\dtrack\App_Code\ProductRepository.cs: 22 fosDashBoard.loadProducts() h:\root\home\dtrack-001\www\dtrack\fosDashBoard.aspx.cs: 54 fosDashBoard.Page_Load ( , EventArgs e) h:\root\home\dtrack-001\www\dtrack\fosDashBoard.aspx.cs: 22 System.Web.Util.CalliEventHandlerDelegateProxy.Callback ( , EventArgs e) +51 System.Web. UI.Control.OnLoad(EventArgs e) +95 System.Web.UI.Control.LoadRecursive() +59 System.Web.UI.Page.ProcessRequestMain ( includeStagesBeforeAsyncPoint, includeStagesAfterAsyncPoint) [CN0

-1
source

Source: https://habr.com/ru/post/1626733/


All Articles