I have implemented my Lock Manager in the following way and am confused after reading a few posts here on the same topic.
My Lock Manager does not use a client id to lock records. The RemoteConnection Object is a singleton and each client gets a refrence of the same object.
The Lock Manager holds a HAshMap of LockedRecords and has a static method that creates the Record Object and returns it back to to the client. The Records Object has a boolean flag to indicate the status of Lock or unlock for each Record.
The whole sequence of lock/unlock is managed in the following way:
Client A - lock(27)
LockManager.getRecords(27)
Record.lock()
Client B - lock(27)
// waits
Client A - //do all modifications
records.unlock()
Client B - //do all moidifications
record.unlock();
I have no where used or felt the need to use a client Id.??
Can someone help me in identifying where the fault is in my code and how/why/when clientid is needed.
I have looked at so many post on this topic and it only adds to my confusion.
Thanks for the help in advance
Rachna