If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > lock in share mode and for update locks does the same

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-07-04, 06:03
mette mette is offline
Registered User
 
Join Date: Mar 2004
Location: London, uk & Denmark
Posts: 5
Question lock in share mode and for update locks does the same

My table type is innodb and the transaction isolation level is set to repeatable read.
My problem is that when I set a lock for update

Set autocommit=0;

Select * from staff for update
……..

It prevents other transactions from updating, inserting or deleting any data in this table. However it still allows other transactions to read data from this table which is shouldn’t!

If I set a lock in share mode

Set autocommit=0;

Select * from staff lock in share mode

It does exactly the same as the above lock does anyone know why this is?

Mette
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On