-
Notifications
You must be signed in to change notification settings - Fork 177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sqltabledependency trigger on my table “locks” all upcoming DML operations #229
Comments
An internal database error occurred. ---> System.Data.SqlClient.SqlException: Transaction (Process ID 66) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction. I am also getting a similar issue. I have a huge traffic of nearly 100-1000 updates per second in the listened columns. Is SQLTableDependency ideal for this scenario with this high traffic? |
so please can anyone answer me ? |
My experience is that this code does not function particularly well under extremely high load where you have a complex schema and I have seen similar errors to what you describe. Frankly at 100-1000 updates per second I don't believe this library is designed for dealing with such high load, nor do I believe it is appropriate to bombard an SQL database in such a way. If I was dealing with such a high load I would probably be looking at database designed specifically for such scenarios or at the very least batching my updates in some sort of intermediary service. With that said I have generally used a retry pattern similar to that described in this question. Along with the following code which ensures that all the queues and contracts related to this library are cleaned up prior to restarting the service.
|
Dear Maxim, |
Hi,
I enable Service Broker on my sql server 2012 to use sqltabledependency in vb.net application to notify me on update a field. but recently I saw a trigger on my table which "locks" all upcoming DML operations to this table. the error message is when I trying to update the field " No row was updated. Error Source: .Net SqlClient Data provider. Error Message: Cannot find object ID 467661280 in database ID 49. Correct the errors and retry or press ESC to cancel the change(s). I disable the trigger named(tr_dbo_Appointments_772a313c-6865-4057-95a7-63dc7b7191e3_Sender) and the locks goes. so why this happen and how to avoid it again. below is the trigger which automatically generated.
USE [db0001]
GO
/****** Object: Trigger [dbo].[tr_dbo_Appointments_772a313c-6865-4057-95a7-63dc7b7191e3_Sender] Script Date: 02/05/2021 6:28:58 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER TRIGGER [dbo].[tr_dbo_Appointments_772a313c-6865-4057-95a7-63dc7b7191e3_Sender] ON [dbo].[Appointments]
WITH EXECUTE AS SELF
AFTER insert, update, delete AS
BEGIN
SET NOCOUNT ON;
END
The text was updated successfully, but these errors were encountered: