Jawad Kakar

Ranch Hand
+ Follow
since Oct 06, 2002
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Jawad Kakar

You have to cast Naming.lookup to the interface which extends Remote.
i.e

and the lookup part looks like

Jawad
For locking the database do we have to provide an admin gui?
Thank you
Jawad
You are right, thank you
Jawad
I changed LockManager from a singleton to a regular class, it is very easy to create multiple instance of LockManager, which is not a very good thing to do for this assignment.

Jawad
Try not to post the same msg in different forum.
Jawad
18 years ago
Although not important, so far I have 29 classes and 3070 lines of code.
Jawad
[ December 27, 2002: Message edited by: Jawad Kakar ]
Eugene,
Thanks for your reply
Which one is better, passing a RemotedataServer for clientId or passing an Object. As far as reusability is concern passing Object is a better idea, am I correct or there is some other reason for it too.

Thank you
Jawad
[ December 27, 2002: Message edited by: Jawad Kakar ]
Peter,
The situation that you have mentioned never happened in my test, but I see the problem in code clearly, thank you very much for the help and I have changed the unlock method to

Thank you
Jawad
Peter,
Thank you for your reply,

Moreover I test lock/unlock creating 500 threads in batch of 10 using the following test program and it seems to me if client 5 locks record 10, then only client 5 unlocks record 10 before any other client try to lock records 10.
I guess I am missing something could you please tell me how to change unlock to fix it.
Test program

Thank you
Jawad
[ December 26, 2002: Message edited by: Jawad Kakar ]
have a look at my getRemoteConnection() method, that is how I do it and it works fine for me.
I am still not done with the assignment, I might change it in future if I find a better reason to do so.
Jawad
This is a default constructor which is for getting different client id.
Jawad
Constructor which binds the remote object to the registry is called only once( when I start the server from command line) which is the following constructor

To bind the remote object to the registry.
The second constructor which no parameter the one you are talking about is called inside getConnection() method.
Therefor remote object is bind to the registry only once.
Jawad
Sri,
Thank you for your reply, you are right that was a mistake and I fixed it.
Thank you
Jawad
It is better to synchronized on the method, easier to read and debug, then to synchroized on block.
Jawad