IsNemoEqualTrue/monitor-table-change-with-sqltabledependency

The conversation handle is not found exception

Opened this issue · 8 comments

Hi Christian,
I found several exceptions in our log regarded to this message:

SqlException: The conversation handle "D8DB994E-3D38-EA11-A2C9-00155D0B460E" is not found.
Invalid object name 'dbo.dbo_ZonePreset_59569b15-087f-449c-b797-d81b599381d8_Receiver'. Exception[0]: Exception[0]:
SqlException: The conversation handle "D8DB994E-3D38-EA11-A2C9-00155D0B460E" is not found.
Invalid object name 'dbo.dbo_ZonePreset_59569b15-087f-449c-b797-d81b599381d8_Receiver'.
Stack trace:
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
at System.Data.SqlClient.SqlDataReader.get_MetaData()
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.CompleteAsyncExecuteReader()
at System.Data.SqlClient.SqlCommand.InternalEndExecuteReader(IAsyncResult asyncResult, String endMethod)
at System.Data.SqlClient.SqlCommand.EndExecuteReaderInternal(IAsyncResult asyncResult)
at System.Data.SqlClient.SqlCommand.EndExecuteReader(IAsyncResult asyncResult)
at System.Threading.Tasks.TaskFactory1.FromAsyncCoreLogic(IAsyncResult iar, Func2 endFunction, Action1 endAction, Task1 promise, Boolean requiresSynchronization)
Source:
Core .Net SqlClient Data Provider

I think that this exception should't be thrown. I think it rollbacks the actual CUD operation.

Thx

@tfabian Hi, can you tell me if with the latest version (8.5.7) you still have this exeption in your log file?

I will monitor the log files for a few days. A will let you know.

Hi fabian. Any news?

Hi,
I'm sorry but I found some related errors again:
ERROR 2020-01-28 12:30:46.4260 [Web api] SqlException: The conversation handle "11C32C1F-C141-EA11-A2C9-00155D0B460E" is not found.

I do not maintain any more this Repository.

Hi @tfabian
I get this exact error every now and then. ATM, we just restart our service when this happens. Did you find resolution or workaround?

Hi @mosabusan,
I have to admit that I'm not sure whether I fixed this issue in my wrapper, but I implemented an automatic reconnection in case of lost connections for SqlTableDependency. Hopefully you will not have to restart your service with SqlTableDependencyProvider. You have to refactor your code a little bit in order to use it:

https://github.com/tomasfabian/Joker/wiki/How-to-convert-from-SqlTableDependency-to-SqlTableDependencyProvider

If you are willing to try it out, log the error messages and check the presence of the above mentioned error.

    protected override void OnError(Exception error)
    {
      //logger.LogError($"SqlTableDependency error {error}");
    }

Let us know what did you find out, thx.

Regards, Tomas.

@mosabusan I checked the error logs in some projects I worked on and I used the above mentioned wrapper. I haven't found this exception inside them as before, but you should test it, too.