IsNemoEqualTrue / monitor-table-change-with-sqltabledependency

Get SQL Server notification on record table change
MIT License
655 stars 177 forks source link

SqlTableDependency Error Invalid object name 'dbo.dbo_XXX_1a3df6fa-1a3b-4847-adb7-a4b86ca9ff3a_Receiver' #196

Open Suresh9sb opened 4 years ago

Suresh9sb commented 4 years ago

I receive very occasionally this error message and sql table dependency stops working. Invalid object name 'dbo.dbo_XXXX_1a3df6fa-1a3b-4847-adb7-a4b86ca9ff3a_Receiver' when I restart windows service it will work fine.

Note: Windows service start every day 1 time. window service implemented code not to into idle state as specified in requirments

Is there any error codes which will triggered when error occurs if connectivity lost to server?

tomasfabian commented 4 years ago

Hi @Suresh9sb, do you have the same exception/stack trace as I have reported in this issue?

https://github.com/christiandelbianco/monitor-table-change-with-sqltabledependency/issues/181

Regards, Tomas

Suresh9sb commented 4 years ago

Hi Tomasfabian,

I frequently observe this messages logged in my windows service after this exception caught sqltabledependency stops receving notifications.

server , Sender : dbo_Table_5c189f89-5ce7-4832-a18d-03cf38d579e7, Msg : Queue containing a message type not expected [http://schemas.microsoft.com/SQL/ServiceBroker/EndDialog]., InnerEx :

As I mentioned need to restart the windows service to reestablish the connection (As feel sqltabledependency lost the connectivity).

In the SqlTableDependency.OnError() event, when the above error raised
SqlTableDependency.Status is StopDueToError

Suresh9sb

hdu7 commented 3 years ago

I got the almost the same issue, one reason could be you restored this database from another database. The database object belongs to the old one. Stop your APP, try to delete all dynamically created triggers, stored procedures, service brokers, and restart your app, it will create a new set of db objects.