Hi everyone,
In my assignment, the DBAccess interface states:
Suppose:
1. We specify that all clients must adhere to contract of lock -> update/delete ->unlock
2. We check in the lock(recNo) method if the recNo is within range and is not deleted (because lock() throws RecordNotFoundException)
Q: Why then do we have to check for RecordNotFoundException again in update or delete. The
thread that has locked a particular record generates a unique cookie and thus, is the
only thread with the unique cookie to update and unlock that record. All other threads cannot update or delete this record because they don't have the unique cookie. If this is so, the states of the record cannot be changed. So why do we need to check for RecordNotFoundException again in update or delete?
Am i missing something?
rgds,
derek