I guess that will have an enormous performance decrease. When reading records I didn't care about a record being locked or not. Every valid (= not deleted) record is read immediately, without waiting until it is unlocked.
I chose a solution where i read locked records, but have synchronized access to my data. In this way data can be dirty in the application, but it will never be dirty upon read.
I also have made a record comparator, so i can compare the data shown, after a search with data in the "database", this way i can check if data has been changed.
So when you are going to make a booking of a room, you lock the record, compare and update your data, and the user will be presented with a choice to continue booking if data has been changed from the search to the booking.
Post by:autobot
Beauty is in the eye of the tiny ad.
a bit of art, as a gift, that will fit in a stocking