File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Any luck with setting java.rmi.dgc.leaseValue

 
Rajesh Matti
Ranch Hand
Posts: 121
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 39
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 121
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tom- Same experience here too. I just could not get it to work.
-Rajesh
 
Mark Spritzler
ranger
Sheriff
Posts: 17276
6
IntelliJ IDE Mac Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Rene Larsen
Ranch Hand
Posts: 1179
Eclipse IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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�
 
Rajesh Matti
Ranch Hand
Posts: 121
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 17276
6
IntelliJ IDE Mac Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 121
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mark - Yes, it did work !!!. Thanks to Rane.
Hope you, busy man, read this one !!!.
-Rajesh
 
tom mcmorrow
Ranch Hand
Posts: 39
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 121
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tom-
Use java -D option as illustrated below.
java -Djava.rmi.dgc.leaseValue=30000 -Djava.rmi.dgc.leaseValue=15000 MAINCLASS
 
dean tomlinson
Ranch Hand
Posts: 94
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 234
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 234
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 17276
6
IntelliJ IDE Mac Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, you should check for crashed clients using Unreferenced. I used the default lease time.
Mark
 
BJ Grau
Ranch Hand
Posts: 234
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 146
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 146
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 146
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 560
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 94
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 560
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 146
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks sai prasad.
 
dean tomlinson
Ranch Hand
Posts: 94
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic