I thought on this too - but it seems impossible to have a locking which can cater to both the local and the server clients - As server clients would use one object of the Data class and the local client would use another. There is no common meeting place for the two except in the Database file - ( just for trial - try marking the record which has to be locked - just as a deleted record is marked).
Then I re-read the instructions and found that Sun expects the user to be EITHER in local or networked mode. So I have used locking for networked mode only.
Pls. also shed light on how are you planning to inform the Client that his
thread is waiting - if the record is locked.