How to manually lock and unlock a row?
问题 I am trying to circumvent double-writes by locking and unlocking certain rows. I have a table personnel and as soon as a user tries to edit a row, I want to lock that row. So BEGIN; // I guess I have to lock it somehow here SELECT * FROM personnel WHERE id = 12; COMMIT; and once an edit as been made, I want to submit the UPDATE in the same style: BEGIN; //Unlocking UPDATE personnel SET ... WHERE id = 12; COMMIT; In the time between, when another user tries to edit the same row, he would get a