// Locks a record so that it can only be updated or deleted by this client. // If the specified record is already locked, the current thread gives up // the CPU and consumes no CPU cycles until the record is unlocked. public void lock(int recNo) throws RecordNotFoundException;
1) Do we have to sychronize the whole lock method or just synchronize only on the recNo. There is also a boolean method isLocked(recNo) which determines whether the current thread has the lock or not.
If the whole lock method is synchronized then there is no need for the boolean method.
If anyone would clarify this it would be of great help.