Hi everybody,
I have certain doubts about my design of the locking an d unlocking .My design of lock and unlock goes some thing like this .
I Have decided to have a lock object for each and every record.
There will be a LockManager which handles all the lock and unlock requests. All the lock requests will be delegated to this lockmanager object which will be a instance member of the data class.And the locks will be stored in a datastructure like a HashSet or LinkedList.
My first doubt regarding the design is:
1. On which object should i synchronize my lock and unlock methods is is the lock object which is availabe for each and every record or the Data structure in which all the lock objects are stored .
2. Should we use timeouts for the threads which are waiting for the access of the database.
3. If we are using RMI,how to recognise a request for lock uniquely ,such that it helps in unlocking the same
thread which has locked the resource.
I think this is the most critical part of the assignment and everyone will have a second thought about it before implementing this particular part of the assignment.
I encourage everyone to give me their sugessions regarding this particular topic(i:e lock an unlock).
Toghther we can acheive it
Thanx in advance for your replies(If you wish to reply..)
waiting for your replies
Lokesh