Subject Re: Troubleshooting Deadlock Exceptions
Author Alexander V.Nevsky
--- In firebird-support@yahoogroups.com, "Robert DiFalco"
<rdifalco@t...> wrote:
> Is there a way to troubleshoot deadlock exceptions? I have a large,
> multi-threaded application with many objects/records spanning many
> tables. Sometimes I get a deadlock exception in strange places, and
the
> information provided by the exception doesn't help me much.
>
> For example, I have a table called ElementVersion that has no
relations
> and whose rows cannot be updated, only inserted and deleted.
Sometimes
> on the INSERT statement for this TABLE I will get a deadlock
exception.
> I have a background process that periodically SET STATISTICS on all
> indices, and this may be the source of the error.
>
> But what I'd like to really know is if there is a way of finding out
> exactly *where* the contention was that caused the deadlock error.
>
> Thoughts?

Robert, have your ElementVersion table FK references to another
tables and can rows of this tables be updated? If so you can get
exceptions when inserting ElementVersion (not sure - lock conflict or
constraint violation). FB knows "master" record is modified but don't
knows what column, so it supposes worth and thinks referenced column
can be modified. Then, I never make indices maintenance the same way
as any DDL statements when database is accessed by users. Can't say
surely, but think it can be source of problem. I have'nt answer for
your last question and suppose this is very hard to report in FB
architecture if possible at all. At least without terrible performance
degradation.

Best regards,
Alexander.