Jason
04/18/2022, 7:47 AMNurul
04/20/2022, 11:47 AMLocking of rows for update usingIn other words, if you don’t execute your firstonly applies when autocommit is disabled (either by beginning transaction withSELECT FOR UPDATE
or by setting autocommit to 0. If autocommit is enabled, the rows matching the specification are not locked.START TRANSACTION
SELECT FOR UPDATE
inside a transaction, no rows are locked.
Reference: MySQL DocsJason
04/20/2022, 2:07 PMNurul
04/21/2022, 11:55 AM