"Kim G. Pedersen" <[EMAIL PROTECTED]> wrote:
> 
> I try in my program to make a lock.
> 
> I try to prevent another session to read and write from the whole table
> I tried both
>  LOCK TABLES pstockx WRITE
> and
>  LOCK TABLES pstockx READ
> 
> but no success.
> 
> I put in a breakpoint in my program to be sure the lock are held
> and then I try to make a select from another session.
> 
> It dont lock me up :(
> 
> What am I doing wrong ,,is it some settings on server ??
> 
> 
>                   8128 Query       LOCK TABLES pstockx READ
> 031211  0:22:05    8133 Connect     [EMAIL PROTECTED]  on elprint
>                   8133 Query       SET SQL_BIG_SELECTS=1
>                   8133 Query       select amount from pstockx where
> productID =
> 82846
>                   8133 Query       EXPLAIN select amount from pstockx
> where pro
> ductID = 10000
> 031211  0:23:06    8128 Query       SHOW COLUMNS FROM pstockx
>                   8128 Query       SHOW INDEX FROM pstockx
>                   8128 Query       select amount from pstockx where
> productID=8
> 2846
> 

LOCK TABLE .. READ allows other threads read from the table.
As for LOCK TABLE .. WRITE .. do you use QUERY CACHE?


-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Victoria Reznichenko
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
       <___/   www.mysql.com





-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to