Hi, I'm writing a RMI based client server application. The client allows to
read and update records. I'm writing lock and unlock methods that so that
only one client can update a particular record at a time.
At server I'm having vector to hold locked records. My original plan was to
synchronize LOCK and UNLOCK methods. But I thought this is not a good
design. Consider the following situation :
1. Client A wants to lock record 1
2. Client B wants to lock record 2
Why should Client B wait until Client A completes Locking process
though Client B wants to lock different record ?
So I'm thinking of having lock on each object in the vector instead of
synchronizing LOCK & UNLOCK methods. But confused about logic.
I REALLY APPRECIATE SOME IDEAS / SUGGESTIONS..
Thanks
read and update records. I'm writing lock and unlock methods that so that
only one client can update a particular record at a time.
At server I'm having vector to hold locked records. My original plan was to
synchronize LOCK and UNLOCK methods. But I thought this is not a good
design. Consider the following situation :
1. Client A wants to lock record 1
2. Client B wants to lock record 2
Why should Client B wait until Client A completes Locking process
though Client B wants to lock different record ?
So I'm thinking of having lock on each object in the vector instead of
synchronizing LOCK & UNLOCK methods. But confused about logic.
I REALLY APPRECIATE SOME IDEAS / SUGGESTIONS..
Thanks