Thanks for suggestion. I do have a multi-tier validation check, including client-side checking and server-side checking.
If I implement what you mentioned above at server side, it does ensure that an "already-updated" record will not get overwriten (i.e. a record won't get booked twice). If this is the case, how do you handle cancellation/re-book scenario like: Client A booked a room as indicated a valid ID in DB last week, and now want to cancel the booking. We should make this record bookable again by making owner field empty.
I have read a few posts here. There are a lot of good discussions (like Peter Den Haan, Philippe Maquet etc ). Most of them handle booking in the way as you mentioned above.
In addition client-side checking, I am going to do server side checking as well. Before tryin to update a record by entering owner ID, I will check to see if this record is bookable (i.e. an empty owner field ?) No overwrite is allowed in DB. It is obvious that cancellation of a booked record is not allowed. Therefore my bookRoom method at business tier like this:
lock
if (isBookable() ) // inside isBookable(), call db.read(recNo) and check owner field
update(recNo)
unlock
Please make comments if I am working to the right direction.