How to implement pessimistic locking in a php/mysql web application?
- web-user opens a page to edit one dataset (row)
- web-user clicks on the button "lock", so other users are able to read but not to write this dataset
- web-user makes some modifications (takes maybe 1 to 30 minutes)
- web-user clicks "save" or "cancel" and the "lock" is removed
Are there standard methods in php/mysql for this scenario? What happens if the web-user never clicks on "save"/"cancel" but closes the internet-exploror?