我有应用程序注册多个SQLDependencies;在DB中发生更改时会触发事件。
在正常情况下一切正常但如果我们多次重启SQL Server,那么注册通知的新请求就会挂起。
进行了转储并从分析中发现了一个带有Underneath Stack的SQL线程。有谁知道这个帖子在做什么?
System.Data.SqlClient.SqlInternalConnection.OnError(System.Data.SqlClient.SqlException, Boolean)
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
System.Data.SqlClient.TdsParser.Run(System.Data.SqlClient.RunBehavior, System.Data.SqlClient.SqlCommand, System.Data.SqlClient.SqlDataReader, System.Data.SqlClient.BulkCopySimpleResultSet, System.Data.SqlClient.TdsParserStateObject)
System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean)
System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(System.Data.SqlClient.ServerInfo, System.String, Boolean, System.Data.SqlClient.SqlConnection, System.Data.SqlClient.SqlConnectionString, System.Data.ProviderBase.TimeoutTimer)
System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(System.Data.SqlClient.SqlConnection, System.Data.ProviderBase.TimeoutTimer, System.Data.SqlClient.SqlConnectionString, System.String, Boolean)
System.Data.SqlClient.SqlInternalConnectionTds..ctor(System.Data.ProviderBase.DbConnectionPoolIdentity, System.Data.SqlClient.SqlConnectionString, System.Object, System.String, System.Data.SqlClient.SqlConnection, Boolean)
System.Data.SqlClient.SqlConnectionFactory.CreateConnection(System.Data.Common.DbConnectionOptions, System.Object, System.Data.ProviderBase.DbConnectionPool, System.Data.Common.DbConnection)
System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(System.Data.Common.DbConnection, System.Data.ProviderBase.DbConnectionPoolGroup)
System.Data.ProviderBase.DbConnectionFactory.GetConnection(System.Data.Common.DbConnection)
System.Data.ProviderBase.DbConnectionClosed.OpenConnection(System.Data.Common.DbConnection, System.Data.ProviderBase.DbConnectionFactory)
System.Data.SqlClient.SqlConnection.Open()
SqlDependencyProcessDispatcher+SqlConnectionContainer.Restart(System.Object)
SqlDependencyProcessDispatcher+SqlConnectionContainer.AsyncResultCallback(System.IAsyncResult)
System.Data.SqlClient.SqlConnection.OnError(System.Data.SqlClient.SqlException, Boolean)
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
System.Data.SqlClient.SqlCommand.InternalEndExecuteReader(System.IAsyncResult, System.String)
System.Data.SqlClient.SqlCommand.EndExecuteReader(System.IAsyncResult)
SqlDependencyProcessDispatcher+SqlConnectionContainer.AsyncResultCallback(System.IAsyncResult)
System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
System.Data.Common.DbAsyncResult.ExecuteCallback(System.Object)
System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
System.Threading.ThreadPoolWorkQueue.Dispatch()
System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()