Jump to content

Lock single record...


ToonMariner

Recommended Posts

I have a process where I need to lock just one record of a table.  Locking the entire table would cripple the rest of the site simply due to the volume of request that use this table.

I have read that the InnoDB type supports this but I am not sure how to execute the lock on a single record - do the updates and then release the lock.

ANy help would be very much appreciated.
Link to comment
Share on other sites

From http://dev.mysql.com/doc/refman/5.0/en/internal-locking.html

[quote]InnoDB uses row locks and BDB uses page locks. For these two storage engines, deadlocks are possible because they automatically acquire locks during the processing of SQL statements, not at the start of the transaction.[/quote]

Yep, myisam doesn't have row-level locking.  You'll need to use innoDB (or switch to postgresql :P )
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.