in reply to Re: DBI and table locking
in thread DBI and table locking

Thanks a lot. This answers my question and I know that I can safely WRITE lock my table for a quick operation and I don't need to provide error handling for other programs that access this table. Many thanks.

Replies are listed 'Best First'.
Re (tilly) 3: DBI and table locking
by tilly (Archbishop) on Jan 07, 2001 at 23:36 UTC
    But if you are grabbing several locks be careful about what order you do it in. If programs X and Y grab locks on tables A and B respectively, and then try to lock B and A, they get into this pathetic staring contest called a deadlock. This is generally a Bad Thing...

      Obviously this is good advice in the general case, but it's slighly moot for the OP, who said he was on MySQL. It's impossible to get deadlock in MySQL as you have to declare all your locks at once .. declaring a new lock after that will free your current one.

      Tony

        Really?

        Remind me to avoid having to rely on MySQL for anything I care about then. Of course they don't understand ACID, which makes them a poor fit for a lot of areas. OTOH it gives them good performance, and it is "good enough" for many things.

        But the inflexible locking policy would be a problem for me.