Subject Re: [firebird-support] What to do with long-lasting deadlock?
Author Helen Borrie
At 12:31 AM 23/08/2006, you wrote:
>So - there are made some updates on records from other app - and now -
>after hours/days there is deadlock when another application is trying
>to updates this record. How to remove this deadlock?

Is it a genuine deadlock (isc code 335544336) or some other conflict?

>Does gfix -commit all can help,

No, that's for resolving limbo transactions. It doesn't address
long-running transactions with conflicting configurations. Only
improving your application code will fix that.

>or the only solution is the full B/R of database.

Full B/R *would* solve it; but it's not the solution you are looking for.

>There is not problem about 2-phase commit because only one DB is involved.

Exactly.


>I am asking how to resolve simptoms on already running production system

A controlled shutdown of the server should do it. The two
conflicting client instances won't be able to exit gracefully, but
you should begin by 1) getting everyone else to shut down their
applications; 2) performing a controlled database shutdown and,
finally, shutting down the server service and then restarting it.

>, not - how to make deadlock-free programs (this is completely another issue).

Sure; but it's definitely signalling that the application design
needs attention. Of most immediate concern is why your application
code is not handling conflict exceptions; and, if you are getting
genuine deadlocks, you've also got to attend to the way your
transactions are configured. It's totally daft to deploy a
multi-user system that has to be stopped and restarted to resolve conflicts.

./heLen