This question already has an answer here:
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:
select for update
select another table
does the commit release the lock or the update?