Hi, Mark, Max,
Thank you for the reply. I went back to my lock() and unlock() again just to familiarize myself (I did most of the
SCJD coding about 6 months ago, and slept on it for almost half year, and determined finally to finish the exam by the end of this month hopefully. For the ranchers out there, please don't laught me at this

). Anyway, I realized that I misrepresented something in the previous post.
For each Data Server, there is actually only one DataLockManager instance associated (no matter how many clients are connected with the server).
Question #1: Given that, I don't even need to make my HashMap that stores the recordId and clientId pair static anymore, right?
You should only have one instance of the DataLockManager, and it shouldn't be a Singleton though. Like you create one instance of the Data class, you will also have only one LockManager created, which every Client Remote Object should have a reference too, not a seperate instance created in each.
[B]Question #2: Did not quite understand the above quote. I should only have one DataLockManager for each DataServer I create (each DataServer is in term associated with a Data file), right? But what if I have multiple data servers started with the same data file, I still only should have one DataLockManager associated with that Data file. Then, how am I going to keep track?
As far as my current implementation goes, if server#1 and Server#2 decided to serve the same database, then, DataLockManager#1 and DataLockManager#2 is created respectively. If the HashMap is static, that's okay. But I am thinking about changing the HashMap to just a member variable. Since if it is static, what if Server#1 and Server#2 started on different data file, the HashMap will be shared by different data files, which is not correct at all. What do you think about that?
[B]Question #3, if both HashMap and the dblocked flag are not static, should I use synchronized on the whole function? What is the advantage of only synchronizing on the HashMap. In addition, in my code where i have "wait()", according to Max's comment, shouldn't I use "mLockedRecord.wait()" as well if I just synchronize on mLockedRecord.
I hope I am making sense here. Thanks.
Christy