Handling Trigger deadlocks efficiently

Posted by James Cates on 07-Jun-2016 11:13

We're experiencing intermittent deadlocks with triggers when calling update or insert procedures from a .Net application. Now, previous developers created a "retry" method, which retries 5 times using a sleep of 5 seconds between tries, but this is often enough exceeded that users are complaining. I don't like trying to solve issues like this in the code, I would rather do it at the db or data layer level. Ideas? Best practices for this type of problem?

All Replies

Posted by Frank Meulblok on 10-Jun-2016 04:55

I'm assuming you're talking about deadlocks in record locking.

As general advice, those are usually happening because of scoping issues and/or race conditions which *are* coding issues.

So wether you like it or not, solving issues in the code is the better approach

Posted by James Cates on 10-Jun-2016 11:08

In this case, not so much. I found out that sometime recently, a constant replication (trickle) had been started from MS-SQL to Progress. This is, seemingly when the issues started to crop up. So, they are intermittent deadlocks due to all the replication inserts/updates in combination with normal insert/update triggers on many of the same tables.

This thread is closed