aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Any luck with setting java.rmi.dgc.leaseValue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Any luck with setting java.rmi.dgc.leaseValue" Watch "Any luck with setting java.rmi.dgc.leaseValue" New topic
Author

Any luck with setting java.rmi.dgc.leaseValue

Rajesh Matti
Ranch Hand

Joined: Jan 07, 2002
Posts: 121
Did anybody have any luck with getting "-Djava.rmi.dgc.leaseValue" to work to change the default value ?. Please let me know,
-Rajesh
tom mcmorrow
Ranch Hand

Joined: Jan 11, 2002
Posts: 39
hi Ragesh
i have spent some time on the same problem and found the results to be very unpredictable. i generally end up with just the default results i think no matter how i set leaseValue. Was using it primarly for testing so i do not think i will use it in the final product.
If you find something useful on it mention it on this board as i am interested.
tom
Rajesh Matti
Ranch Hand

Joined: Jan 07, 2002
Posts: 121
Tom- Same experience here too. I just could not get it to work.
-Rajesh
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17260
    
    6

What was leaseValue for? Is it necessary for the assignment? I don't remember seeing that one, maybe that is a cool one. Tell us some more about it
Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Rene Larsen
Ranch Hand

Joined: Oct 12, 2001
Posts: 1179

Hi,
Set the sun.rmi.dgc.checkInterval property to half of the setting of
java.rmi.dgc.leaseValue.

You can read more about them here:
java.rmi Properties and sun.rmi Properties
/Ren�


Regards, Rene Larsen
Dropbox Invite
Rajesh Matti
Ranch Hand

Joined: Jan 07, 2002
Posts: 121
Thank you so much Ren�.
Mark-
This is the value used by the RMI to sense a unreferenced object in cases like client crash etc. Since I have implemented unreferenced interface, I needed to test the working of it and right now, it takes almost 15 minute to notice it working after I hard-kill the client. I just wanted to test more by temporarily reducing this wait time.
Hope this makes sense.
Thanks,
-Rajesh
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17260
    
    6

Rajesh, cool. I knew I had seen it before, and thought that might be what it was for. I wanted to do that too, but I didn't, I waited those long 15 minutes
So did Rene's solution do the trick?
Mark
Rajesh Matti
Ranch Hand

Joined: Jan 07, 2002
Posts: 121
Mark - Yes, it did work !!!. Thanks to Rane.
Hope you, busy man, read this one !!!.
-Rajesh
tom mcmorrow
Ranch Hand

Joined: Jan 11, 2002
Posts: 39
hi all
Still not clear on how to change leaseValue. Do i still use rmi.dgc.leaseValue=newValue on the command line. How do i employ sun.rmi.dgc.checkInterval()if I want to change my leaseValue?
tom
Rajesh Matti
Ranch Hand

Joined: Jan 07, 2002
Posts: 121
Tom-
Use java -D option as illustrated below.
java -Djava.rmi.dgc.leaseValue=30000 -Djava.rmi.dgc.leaseValue=15000 MAINCLASS
dean tomlinson
Ranch Hand

Joined: Jan 31, 2002
Posts: 94
the requirements seem to be strict about the configuration parameters that can be used in the command lines to start the server / client.
have people have set the rmi.unreferenced lease value within the main method for their data server - using something like...
// Get system properties
Properties props = System.getProperties();

// Specify lease value
props.put("java.rmi.dgc.leaseValue", 15000);
[ May 26, 2002: Message edited by: dean tomlinson ]
BJ Grau
Ranch Hand

Joined: Jul 10, 2001
Posts: 234
Originally posted by tom mcmorrow:
hi all
Still not clear on how to change leaseValue. Do i still use rmi.dgc.leaseValue=newValue on the command line. How do i employ sun.rmi.dgc.checkInterval()if I want to change my leaseValue?
tom

java -Djava.rmi.dgc.leaseValue=30000 -Djava.rmi.dgc.checkInterval=15000
BJ Grau
Ranch Hand

Joined: Jul 10, 2001
Posts: 234
I thought of checking for crashed clients, but decided not to. Are any of you incorporating this into your final product? If so, what kind of lease times are you using?
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17260
    
    6

Yes, you should check for crashed clients using Unreferenced. I used the default lease time.
Mark
BJ Grau
Ranch Hand

Joined: Jul 10, 2001
Posts: 234
By default, I am doing this because I am checking for clients that are finished with remote objects using Unreferenced. The only difference is that when clients finish gracefully Unreferenced.unreferenced() gets called very quickly, but with a crashed client it takes a while according ot the lease time and check interval. For this to be usefull for crashed clients the lease time and check interval need to be shortened, I would think, to a matter of seconds. Otherwise a crashed client could hold a lock for a matter of minutes, which in this application, might as ell be forever because a user isn't going sit around and wait to book a flight that is locked for so long.
But if you reduce the lease and check interval too low, you will tie up the network with lease renewalls.
What is everyone setting their lease time and check interval too? Since there is nothing in the requirements about crashed clients do we really need to worry about it? Mark, you and I discussed this in another post and you thought not.
-BJ
Ramesh kumaar
Ranch Hand

Joined: Mar 19, 2002
Posts: 146
Hi Guys,
Any of u please explain me what is the need of executing the server with the following option, Is in necessary to use this option as per the sun's requirement.
java -Djava.rmi.dgc.leaseValue=30000
Will i loose any marks if iam not using this option.
Ramesh kumaar
Ranch Hand

Joined: Mar 19, 2002
Posts: 146
Hi Guys,
Any of u please explain me what is the need of executing the server with the following option, Is in necessary to use this option as per the sun's requirement.
java -Djava.rmi.dgc.leaseValue=30000
Will i loose any marks if iam not using this option.
Ramesh kumaar
Ranch Hand

Joined: Mar 19, 2002
Posts: 146
Hi Guys,
Any of u please explain me what is the need of executing the server with the following option, Is in necessary to use this option as per the sun's requirement.
java -Djava.rmi.dgc.leaseValue=30000
Will i loose any marks if iam not using this option.
Sai Prasad
Ranch Hand

Joined: Feb 25, 2002
Posts: 560
I don't think your configuration parameter option is one of the listed ones in the requirement. You will lose marks if you use it.
dean tomlinson
Ranch Hand

Joined: Jan 31, 2002
Posts: 94
the requirements seem to be strict about the configuration parameters that can be used in the command lines to start the server / client.
what about setting the rmi.unreferenced lease value within the main method for their data server - using something like...
// Get system properties
Properties props = System.getProperties();
// Specify lease value
props.put("java.rmi.dgc.leaseValue", 15000);
Sai Prasad
Ranch Hand

Joined: Feb 25, 2002
Posts: 560
I guess you can do that. I didn't restrict the leastime instead I had a cleanup thread to remove the unused locks.
Ramesh kumaar
Ranch Hand

Joined: Mar 19, 2002
Posts: 146
Thanks sai prasad.
dean tomlinson
Ranch Hand

Joined: Jan 31, 2002
Posts: 94
hi guys,
do we need to specify the check interval aswell as the lease value, if we are happy using the default check interval of half the lease value.
java -Djava.rmi.dgc.leaseValue=30000 -Djava.rmi.dgc.checkInterval=15000

i'm wondering if the setting of the checkInterval in the line above is redundant, becasue it is being set to half the lease value ?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Any luck with setting java.rmi.dgc.leaseValue