Dear all:
here is my question...
public class Data exntends UnicastRemoteObject implements DBMain {
public synchronized
String[] read(int recNo) throws
RecordNotFoundException, RemoteException {
//implement
}
public synchronized void update(int recNo, String[] data) throws
RecordNotFoundException, RemoteException {
//implement
}
public synchronized void delete(int recNo) throws
RecordNotFoundException, RemoteException {
//implement
}
// other method implementation ......
}
Every client will get the same Data object,
if ClientA wants to delete(13), there is no need to lock(13) first,
because ClientA must had object lock first and then can execute delete(13), in the situation, which client have data object lock, and the client is the only
thread that allowd to access the database.
why still need lock(), unLock(), isLock() mechanism?
hopes my question is clearly ^^"