Subject Re: [firebird-support] how to resolve this deadlock
Author Hamish Moffatt
On 11/09/18 00:48, Svein Erling Tysvær setysvar@... [firebird-support] wrote:
 
Hi Hamish!

What exactly do you mean by "The queries kind of don't actually conflict"? If they're trying to MERGE into the same row simultaneously, then they do actually conflict, even if they contain the same values. Strictly speaking, I think you have a 'lock conflict' and not a 'deadlock' (a proper deadlock would be more if transaction A has updated record a and waits to update record b, when transaction B has updated record b and waits to update record a).

One way to solve lock conflicts can sometimes be to insert into a separate table (never update) and then have a separate batch process that goes through this table and updates the real tables monthly, daily or every hour. But I've no idea whether this is of any help in your situation.

Hi Set,

I mean that at high level they don't conflict because they write the same values. From Firebird's point of view obviously they do conflict. I say a deadlock because that is what is being reported by Firebird in the error message;

SQLCODE: -913
- deadlock
- update conflicts with concurrent update
- concurrent transaction number is 22464


Unfortunately your journal / batch update solution doesn't help in my case. Thanks for the suggestion though.

Hamish