- How to give locking hints in MySQL - MySQL does allow you to specify directly what locks should be acquired in a SELECT, with the lock hints FOR UPDATE and LOCK IN SHARE MODE. Basically, FOR UPDATE gets write locks, and LOCK IN SHARE MODE gets shared read locks on the rows read. You can read more about this on the manual page SELECT … FOR UPDATE and SELECT … LOCK IN SHARE MODE Locking Reads.
- Select lock in share mode and for Update - n MySQL/Innodb LOCK IN SHARE MODE and SELECT FOR UPDATE are more than hints. Behavior will be different from normal SELECT statements. Here is simple example ...
|
|
|