I yet not functionally started assignment, but doing groundwork, writing small small patch of code with db.db. I confused with implementing with Lock & Unlock methods since they ought to be called from client. In order to track the client while executing Locking / Unlocking mechanism over Database record, Client Id has to be passed. By which way we can pass client id to the server, So we can ensure this client acquired the lock on the record. Since we have lock / Unlock / Modify are separate methods how come we can ensure thread safeness by Synchronized(DataInfo_obj). I can find the way out.
Hi, You can find which client wants to lock the record by calling this. Thread caller = Thread.currentThread(); then find out if the caller is same as owner then you need not wait to lock again, if not wait for the record to be unlocked. Thanks.
You can use getCurrentThread() if you are using Object Serialization, if you chose RMI you need to read most of the other Lock, Unlock posts on this newsgroup. The answer is out there. We are not alone Mark
Don't know. I think that all comes down to how JVM creates thread identifiers. Or would the chance of them being the same 1 in infinity? I wonder if they are created using a random generator based on the time in milliseconds? Anyway I am using RMI, so I didn't have to come across that issue. Maybe I could use that as a consideration on my essay exam on why I chose RMI. Just a thought, I don't know . Mark [This message has been edited by Mark Spritzler (edited October 19, 2001).]