Subject Re: [firebird-support] Deadlocks
Author Milan Tomeš - Position
Hi Norman,

sorry for a mistake in your name :)

Dne 3.6.2011 10:00, Dunbar, Norman (Capgemini) napsal(a):
>
> Hi Milan,
>
> >> Hi Dunbar,
> It's Norman. ;-)
>
> <SNIP>
>
> >> Imagine situation, that you have only one query running
> >> against DB with simple update of 1 table (no other tables are
> involved) and
> >> it sometimes goes into deadlock too. That's what I can't understand
> to.
> If you have ONE transaction then you cannot be getting a deadlock. You
> need two transactions for that. Unless, of course, the system itself is
> doing something with resources that your transaction requires - but you
> say that you are updating only one table. :-(
>

And surprisingly I'm really getting a deadlock (randomly, not
everytime). That's the "strange behaviour" that I mentioned. But even if
I run multiple queries (each one is updating records that other queries
is not using - I'm sure about that) against one table I sometimes get a
deadlock

>
> >> And in this case - I think - doesn't wait or no_wait matter. I'm I
> right?
> I don't think this scenario is actually a deadlock. :-(
>
> >> Another situation is, that I'm running multiple queries at one time
> >> against 1 table, but every of the query is updating records
> >> that are not a subject to update for other queries (and again - no
> other
> >> tables are involved) and deadlock is sometime happening again.
> I don't know if it is possible in Firebird, but it might be a deadlock
> on indexes perhaps? Hopefully, someone more knowledgeable than me will
> chip in here!
>
> <SNIP>
>
> >> Unfortunatelly - in this case it's impossible, because this
> >> is just one update query and it's run just once. Transaction is
> >> committed right after query is executed (but it can take a few
> hours).
> As above, one update cannot deadlock, unless triggers and autonomous
> transactions elsewhere are involved, events etc? Maybe?
>

There is a trigger, but its function is to generate primary key using
sequence and at this time it has no effect (but it's still fired I
guess). Maybe I will disable them after data import (I can benefit from
increased speed).

>
> <snip>
>
> >> Another strange behaviour - no exception is raised.
> Hmm. This doesn't sound like a deadlock to me.
>

Firebird's log file says that. But to be honest - in most cases
exception is fired, but not everytime.

>
> <snip>
>
> >> Just for you info - I'm attaching 2 dumps of lock manager
> >> dumps and it seems that it doesn't contain any deadlock. But I don't
> >> understand this dump too much so I can be wrong.
> I'm afraid the attachments were removed. If you can, send them to me at
> the following emails:
>
I will and I really appreciate your help.

Thanks a lot

Milan



[Non-text portions of this message have been removed]