Re: FOR UPDATE combined in a single query
Posted by:
Rick James
Date: February 10, 2013 10:05AM
As far as the outside world can see, nothing happens until the COMMIT. So, does it matter? OK, maybe the TRANSACTION ISOLATION LEVEL partially controls this.
I suggest you write two PHP (or other) scripts, stick SLEEP(5) in them (certainly not more than 50 seconds), and play the scripts in "parallel". Note: In case 1, use PHP's sleep; in case 2, use MySQL's.
The TRANSACTION ISOLATION LEVEL may also factor in, so try it with different values.
There are two things to look for -- what values does the second script see, and when does the it run. This last question will answer your locking question.
Also try with/without FOR UPDATE.
Subject
Written By
Posted
February 07, 2013 11:06AM
February 07, 2013 12:15PM
February 08, 2013 02:28AM
Re: FOR UPDATE combined in a single query
February 10, 2013 10:05AM
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.