Hello
If I do:
What happens when another process arrives on 1 and tablename is already locked it wait until the table is unlocked?
Imagine something go very wrong and the code its interrupted in 3) for example, the table will stay locked. How will I solve that/How can I implicity release all locks?
Thanks
If I do:
Code:
1) mysql_query('LOCK TABLE tablename');
2) mysql_query('SELECT * from tablename where condition=0');
3) if (cond) {
4) mysql_query('UPDATE tablename SET condition=1 WHERE condition=0');
5) }
6) mysql_query('UNLOCK TABLE tablename');
What happens when another process arrives on 1 and tablename is already locked it wait until the table is unlocked?
Imagine something go very wrong and the code its interrupted in 3) for example, the table will stay locked. How will I solve that/How can I implicity release all locks?
Thanks