A
Andrew Teece
We have a problem with our Windows Service that uses SQLDependency. It has
been crashing and not going through any of my exception management code.
The following is logged in the Windows Application Event log;
EventType clr20r3, P1 enate.mi.serverservice.exe, P2 1.0.0.6, P3
4991797a, P4 system.data, P5 2.0.0.0, P6 4889deaf, P7 2753, P8 29, P9
system.data.sqlclient.sql, P10 NIL.
For more information, see Help and Support Center at
http://go.microsoft.com/fwlink/events.asp.
After a crash-course in WinDBG and DebugDiag I have managed to get a memory
dump of the situation. By examining the thread with the error I found the
following exception;
Exception object: 0f66cde8
Exception type: System.Data.SqlClient.SqlException
Message: The conversation handle "68F91595-7EF7-DD11-A7C3-0011432742A1"
is not found.
Invalid object name
'SqlQueryNotificationService-5166b3f6-1909-464b-b1f9-f1fd264bb0c9'.
InnerException: <none>
StackTrace (generated):
SP IP Function
0677EFF4 656D286B
System_Data_ni!System.Data.SqlClient.SqlConnection.OnError(System.Data.SqlClient.SqlException,
Boolean)+0x1dc4ab
0677F008 656C8DEC
System_Data_ni!System.Data.SqlClient.SqlInternalConnection.OnError(System.Data.SqlClient.SqlException,
Boolean)+0x49f51c
0677F020 652294F3
System_Data_ni!System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(System.Data.SqlClient.TdsParserStateObject)+0xc3
0677F050 6560A8D5
System_Data_ni!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)+0x959
0677F0BC 65220F12
System_Data_ni!System.Data.SqlClient.SqlDataReader.ConsumeMetaData()+0x22
0677F0D0 65220A34
System_Data_ni!System.Data.SqlClient.SqlDataReader.get_MetaData()+0x54
0677F0FC 6521F3EA
System_Data_ni!System.Data.SqlClient.SqlCommand.FinishExecuteReader(System.Data.SqlClient.SqlDataReader,
System.Data.SqlClient.RunBehavior, System.String)+0x12a
0677F134 654F2DC0
System_Data_ni!System.Data.SqlClient.SqlCommand.CompleteAsyncExecuteReader()+0x6c
0677F168 654F43D0
System_Data_ni!System.Data.SqlClient.SqlCommand.InternalEndExecuteReader(System.IAsyncResult,
System.String)+0x7c
0677F19C 654F45C9
System_Data_ni!System.Data.SqlClient.SqlCommand.EndExecuteReader(System.IAsyncResult)+0x49
0677F1CC 6562EE89
System_Data_ni!SqlDependencyProcessDispatcher+SqlConnectionContainer.AsyncResultCallback(System.IAsyncResult)+0x45
StackTraceString: <none>
HResult: 80131904
My understanding from the stack-trace is that this is not an error in my
code? It is an error in the Microsoft SQLDependency class, but because that
is running on a background thread any exceptions thrown cannot be caught by
my application. Is this correct? What can I do to handle such eventualities?
Regards
Andrew Teece
Technical Architect, eNate
been crashing and not going through any of my exception management code.
The following is logged in the Windows Application Event log;
EventType clr20r3, P1 enate.mi.serverservice.exe, P2 1.0.0.6, P3
4991797a, P4 system.data, P5 2.0.0.0, P6 4889deaf, P7 2753, P8 29, P9
system.data.sqlclient.sql, P10 NIL.
For more information, see Help and Support Center at
http://go.microsoft.com/fwlink/events.asp.
After a crash-course in WinDBG and DebugDiag I have managed to get a memory
dump of the situation. By examining the thread with the error I found the
following exception;
Exception object: 0f66cde8
Exception type: System.Data.SqlClient.SqlException
Message: The conversation handle "68F91595-7EF7-DD11-A7C3-0011432742A1"
is not found.
Invalid object name
'SqlQueryNotificationService-5166b3f6-1909-464b-b1f9-f1fd264bb0c9'.
InnerException: <none>
StackTrace (generated):
SP IP Function
0677EFF4 656D286B
System_Data_ni!System.Data.SqlClient.SqlConnection.OnError(System.Data.SqlClient.SqlException,
Boolean)+0x1dc4ab
0677F008 656C8DEC
System_Data_ni!System.Data.SqlClient.SqlInternalConnection.OnError(System.Data.SqlClient.SqlException,
Boolean)+0x49f51c
0677F020 652294F3
System_Data_ni!System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(System.Data.SqlClient.TdsParserStateObject)+0xc3
0677F050 6560A8D5
System_Data_ni!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)+0x959
0677F0BC 65220F12
System_Data_ni!System.Data.SqlClient.SqlDataReader.ConsumeMetaData()+0x22
0677F0D0 65220A34
System_Data_ni!System.Data.SqlClient.SqlDataReader.get_MetaData()+0x54
0677F0FC 6521F3EA
System_Data_ni!System.Data.SqlClient.SqlCommand.FinishExecuteReader(System.Data.SqlClient.SqlDataReader,
System.Data.SqlClient.RunBehavior, System.String)+0x12a
0677F134 654F2DC0
System_Data_ni!System.Data.SqlClient.SqlCommand.CompleteAsyncExecuteReader()+0x6c
0677F168 654F43D0
System_Data_ni!System.Data.SqlClient.SqlCommand.InternalEndExecuteReader(System.IAsyncResult,
System.String)+0x7c
0677F19C 654F45C9
System_Data_ni!System.Data.SqlClient.SqlCommand.EndExecuteReader(System.IAsyncResult)+0x49
0677F1CC 6562EE89
System_Data_ni!SqlDependencyProcessDispatcher+SqlConnectionContainer.AsyncResultCallback(System.IAsyncResult)+0x45
StackTraceString: <none>
HResult: 80131904
My understanding from the stack-trace is that this is not an error in my
code? It is an error in the Microsoft SQLDependency class, but because that
is running on a background thread any exceptions thrown cannot be caught by
my application. Is this correct? What can I do to handle such eventualities?
Regards
Andrew Teece
Technical Architect, eNate