What is the most efficient way to lock a specific row for within a mysql transaction. I am currently using for update using select is there another method that im unaware of?
if not are mysql locks only released when committed or rolled back?
for example i run the following transaction:
begin
select for update
insert..
insert..
update(locked table)
select another table
commit
does the commit release the lock or the update?