MySQL Forums
Forum List  »  Newbie

Re: table locking
Posted by: Rick James
Date: April 06, 2009 07:29PM

FOR UPDATE needs to be inside a transaction for it to block other updates.

Plan A:
BEGIN;
SELECT ... FOR UPDATE;
...
COMMIT;

PLAN B:
SET @@autocommit=0;
SELECT ... FOR UPDATE;
...
COMMIT;

Options: ReplyQuote


Subject
Written By
Posted
April 05, 2009 12:30PM
Re: table locking
April 06, 2009 07:29PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.