I throw
RecordNotFoundException in the
lockRecord() only if the
thread in waiting state gets interrupted:
Now, I also check that the record number is a valid positive integer, and if not I throw
IllegalArgumentException, but I guess it could also be valid to throw
RecordNotFoundException.
Now, another possible use that I did not implement, is to check that the record number actually exists in the data file. That is, if the record number is equal to or smaller than the number of records in the database. If not, throw
RecordNotFoundException.
In my case I did not implemented this. The lock manager could lock a record that does not even exist in the data file. Now that I think it over, maybe I should work on this.
[ October 22, 2006: Message edited by: Edwin Dalorzo ]