等待操作超时Win32Exception(0x80004005):等待操作超时天蓝色 [英] The wait operation timed out Win32Exception (0x80004005): The wait operation timed out azure

查看:1368
本文介绍了等待操作超时Win32Exception(0x80004005):等待操作超时天蓝色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从sql azure检索大量数据时出现以下错误.我已经实现了瞬态故障处理,但仍然收到此错误

Following error comes when retrieving large amount of data from sql azure. I have already implement the Transient Fault Handling but still getting this error

描述:在执行当前Web请求期间发生未处理的异常.请查看堆栈跟踪,以获取有关错误及其在代码中起源的更多信息.

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.

异常详细信息:System.ComponentModel.Win32Exception:等待操作超时

Exception Details: System.ComponentModel.Win32Exception: The wait operation timed out

源错误:

在执行当前Web请求期间生成了未处理的异常.可以使用下面的异常堆栈跟踪来标识有关异常的来源和位置的信息.

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.

堆栈跟踪:

[Win32Exception(0x80004005):等待操作超时]

[Win32Exception (0x80004005): The wait operation timed out]

[SqlException(0x80131904):超时已过期.在操作完成之前超时或服务器没有响应. System.Data.SqlClient.SqlConnection.OnError(SqlException异常,布尔值breakConnection,Action 1 wrapCloseInAction) +1789270 System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action 1 wrapCloseInAction)+5340622 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj,布尔调用方HasConnectionLock,布尔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,字符串resetOptionsString)+275 System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior,RunBehavior runBehavior,布尔Boolean returnStream,布尔异步,Int32超时,任务和任务,布尔asyncWrite,SqlDataReader ds)+1421 System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior,RunBehavior runBehavior,布尔值returnStream,字符串方法,TaskCompletionSource 1 completion, Int32 timeout, Task& task, Boolean asyncWrite) +177 System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource 1完成,字符串方法名称,布尔值sendToPipe,Int32超时,布尔值asyncWrite)+208 System.Data.SqlClient.SqlCommand.ExecuteNonQuery()+163 System.Web.SessionState.SqlSessionStateStore.SqlExecuteNonQueryWithRetry(SqlCommand cmd,布尔ignoreInsertPKException,字符串ID)+98

[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, 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.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean 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 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite) +208 System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +163 System.Web.SessionState.SqlSessionStateStore.SqlExecuteNonQueryWithRetry(SqlCommand cmd, Boolean ignoreInsertPKException, String id) +98

[HttpException(0x80004005):无法连接到SQL Server会话数据库. System.Web.SessionState.SqlSessionStateStore.ThrowSqlConnectionException(SqlConnection conn,异常e)+235 System.Web.SessionState.SqlSessionStateStore.SqlExecuteNonQueryWithRetry(SqlCommand cmd,布尔ignoreInsertPKException,字符串ID)+390 System.Web.SessionState.SqlSessionStateStore.SetAndReleaseItemExclusive(HttpContext上下文,字符串ID,SessionStateStoreData项目,对象lockId,布尔newItem)+589 System.Web.SessionState.SessionStateModule.OnReleaseState(对象源,EventArgs eventArgs)+565 System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()+136 System.Web.HttpApplication.ExecuteStep(IExecutionStep步骤,布尔值和已完成同步)+69

[HttpException (0x80004005): Unable to connect to SQL Server session database.] 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 context, String id, SessionStateStoreData item, Object lockId, Boolean newItem) +589 System.Web.SessionState.SessionStateModule.OnReleaseState(Object source, EventArgs eventArgs) +565 System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +136 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +69

版本信息:Microsoft .NET Framework版本:4.0.30319; ASP.NET版本:4.0.30319.34009

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

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

推荐答案

您可以设置更高的超时值,也可以关闭超时值,就像我在下面的代码中所做的那样.请注意,如果保存数据的对象超过2Gb,则可能会遇到错误.您可能需要考虑重新设计查询,以一次获取较小的数据块.

You can set the timeout value higher or you can turn off the timeout value, as I did in the below code. Note that you may encounter errors if the object that holds the data exceeds 2Gb. You may want to consider redesigning your query to take smaller chunks of data at a time.

// 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;

这篇关于等待操作超时Win32Exception(0x80004005):等待操作超时天蓝色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆