Consider the method in the DB interface provided by Sun:
and the program requirements provided by sun:
My instincts tell me that, in this case, I should interperate this requirement (about when to throw RNFEx) as:
"...should do so if a specified record does not exist, AND go ahead and do so in any other appropriate cases where you are looking for a record (or its representative) and cannot find it, since we didn't explicitly state in the requirements that you MUST ONLY do it if the record does not exist or is marked as deleted."
In the unlock method, I am considering the representative of a record to be its record number. If I attempt to unlock record #5, but record #5 is not locked, then I will not be able to find it among the locked records, and therefore should throw a RecordNotFoundException.
At least this way you can provide the information that an attempt was made to unlock a record that was never locked, and possibly track down a breach of the lock(recNo)- modify(recNo)- unlock(recNo) contract.
Any thoughts?
[ November 02, 2004: Message edited by: Jared Chapman ]