List:General Discussion« Previous MessageNext Message »
From:Gerald Clark Date:August 14 2001 1:42pm
Subject:Re: locking tables.
View as plain text  
To avoid the "Fatal Embrace" where two users each lock a table, and
then attempt to read the table the other locked, you must lock
all table you intend to use for the duration of the lock.
The manual clearly states that a subsequent lock or unlock command
will first unlock all the tables you currently have locked.

lazybrain wrote:

> Hello.
> Im wondering whats up with lock tables in mysql.
> 
> i need to lock one table but also insert into another table that does not
> have to be locked.
> why does it need to lock both tables? this is pointless to me if one table
> does not need
> to be locked.
> 
> Also, from the mysql documentation :
> 
> If a thread obtains a WRITE lock on a table, then only the thread holding
> the lock can READ from or WRITE to the table. Other threads are blocked
> 
> this is not true. if you have a write lock, any other connections can read
> from that table
> just not write to it. The documentation does not mention much about unlock
> tables either
> if you do "unlock table beer_table" does it unlock all over tables that are
> lock or just that one?? can someone give me some insight as to how this
> really works please. is there
> any plans to make it so you can lock one table and do whatever you want to
> tables that
> are not locked without locking them? it makes sense to me. Also in the docs
> its says not to use lock tables with insert delayed. but i found somewhere
> else
> on mysql.com/docs that it says you can. that is a big conflicting. thanks to
> anyone
> how sheds light on this.
> peace
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
> 
> To request this thread, e-mail <mysql-thread82444@stripped>
> To unsubscribe, e-mail
> <mysql-unsubscribe-gerald_clark=suppliersystems.com@stripped>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php


-- 
Gerald L. Clark
gerald_clark@stripped

Thread
locking tables.lazybrain14 Aug
  • Re: locking tables.Gerald Clark14 Aug