List:General Discussion« Previous MessageNext Message »
From:Michael Widenius Date:June 30 1999 12:20pm
Subject:Re: Problem: multiple write locks at the same time...
View as plain text  
>>>>> "Jene" == Jene Novakovic <info@stripped> writes:

Jene> Jene Novakovic wrote:
>> After transforming several Perl-cgi-pages to PHP3 and upgrading the code to
>> use locks I get something very ilogic: There seem to be several write and
>> read locks on the same table at the same time. Extract from mysqladmin
>> processlist:

Jene> Hi
Jene> the problem still persists.
Jene> I do not know what I am doing wrong to get 200 READ LOCKS on a table and at
Jene> the same time a WRITE LOCK:
Jene> | Locked | LOCK TABLES Inserat AS I READ, Kunde AS K READ
Jene> | Locked | LOCK TABLES Inserat AS I READ, Kunde AS K READ
Jene> | Locked | LOCK TABLES Inserat AS I READ, Kunde AS K READ
Jene> | Locked | LOCK TABLES Inserat AS I READ, Kunde AS K READ
Jene> | Locked | LOCK TABLES Inserat AS I READ, Kunde AS K READ
Jene> | Locked | LOCK TABLES Inserat AS I READ, Kunde AS K READ
Jene> | Locked | LOCK TABLES Inserat AS I READ, Kunde AS K READ
Jene> | Locked | LOCK TABLES Inserat AS I READ, Kunde AS K READ
Jene> | Locked | LOCK TABLES Inserat AS I READ, Kunde AS K READ
Jene> | Locked | LOCK TABLES Inserat AS I READ, Kunde AS K READ
Jene> | Locked | LOCK TABLES Inserat AS I READ, Kunde AS K READ
Jene> | Locked | LOCK TABLES Inserat AS I READ, Kunde AS K READ
Jene> | Locked | LOCK TABLES Inserat AS I READ, Kunde AS K READ
Jene> | Locked | LOCK TABLES Inserat AS I READ, Kunde AS K READ
Jene> | Locked | LOCK TABLES Inserat AS I READ, Kunde AS K READ
Jene> | Locked | LOCK TABLES Inserat AS I READ, Kunde AS K READ
Jene> | Locked | LOCK TABLES Inserat AS I READ, Kunde AS K READ
Jene> | Locked | LOCK TABLES Inserat AS I READ, Kunde AS K READ
Jene> | Locked | LOCK TABLES Inserat AS I READ, Kunde AS K READ
Jene> | Locked | LOCK TABLES Inserat AS I READ, Kunde AS K READ
Jene> | Locked | LOCK TABLES Inserat WRITE
Jene> | Locked | LOCK TABLES Inserat AS I READ, Kunde AS K READ
Jene> | Locked | LOCK TABLES Inserat AS I READ, Kunde AS K READ
Jene> | Locked | LOCK TABLES Inserat AS I READ, Kunde AS K READ
Jene> | Locked | LOCK TABLES Inserat AS I READ, Kunde AS K READ
Jene> | Locked | LOCK TABLES Inserat AS I READ, Kunde AS K READ
Jene> | Locked | LOCK TABLES Inserat AS I READ, Kunde AS K READ
Jene> | Locked | LOCK TABLES Inserat AS I READ, Kunde AS K READ
Jene> | Locked | LOCK TABLES Inserat AS I READ, Kunde AS K READ

Jene> could it be, that Mysql does not realize during locking that 'LOCK TABLES
Jene> Inserat AS I READ' is the same table as 'LOCK TABLES Inserat WRITE'?

Hi!

Please read the manual sections that explains how MySQL uses locks;
This will help you understand what is going on!

MySQL uses table locks where, by default, UPDATES has higher priority
than SELECT.  This means that if you do an INSERT on a table, all
selects that are done after this will wait until the INSERT is
completed.

You can avoid this to some degree by using INSERT DELAYED,
HIGH_PRIORITY selects or LOW_PRIORITY updates.

Regards,
Monty
Thread
Problem: multiple write locks at the same time...Jene Novakovic30 Jun
  • Re: Problem: multiple write locks at the same time...matthew mcglynn30 Jun
  • Re: Problem: multiple write locks at the same time...Jene Novakovic30 Jun
    • Re: Problem: multiple write locks at the same time...Michael Widenius30 Jun
  • Re: Problem: multiple write locks at the same time...Scott Hess30 Jun