wood burning stoves 2.0*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes leaseValue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "leaseValue" Watch "leaseValue" New topic
Author

leaseValue

Daniela Ch
Ranch Hand

Joined: Dec 13, 2002
Posts: 96
Hi,
I am using interface Unreferenced() in my remote data access.
I want to change the lease value, but I dont know where to put this set :

Should this be in the server or in the remote data access?
Rene Larsen
Ranch Hand

Joined: Oct 12, 2001
Posts: 1179

You should have a look at this property too:

PS. it should always be half the size of 'java.rmi.dgc.leaseValue'.

The two properties are set where the 'main(..)' method is - where you start your Server.
Rene
[ January 02, 2003: Message edited by: Rene Larsen ]

Regards, Rene Larsen
Dropbox Invite
Daniela Ch
Ranch Hand

Joined: Dec 13, 2002
Posts: 96
Thank you Rene
but I have no idea how to test them...I know it works because when I started coding this application my clients would crash and 15 minutes later I would see my System.out.println("unereferenced called");
How to make the clients crash withou releasing their locks?
daniela
Rene Larsen
Ranch Hand

Joined: Oct 12, 2001
Posts: 1179

You can disable 'unlock(..)' - run some clients, make some locks - shutdown the clients, and wait...

Rene
[ January 03, 2003: Message edited by: Rene Larsen ]
Daniela Ch
Ranch Hand

Joined: Dec 13, 2002
Posts: 96
But how can the client do his method unreferenced() if I shut him down?
Did I get it all wrong?? The Remote data access is the object that implements unreferenced right?
daniela
Daniela Ch
Ranch Hand

Joined: Dec 13, 2002
Posts: 96
AAAAHHHHHHHHHHHHHHHHHHHHHHHHHHH
it works it works
thank you rene
Daniela Ch
Ranch Hand

Joined: Dec 13, 2002
Posts: 96
no...not anymore...
I commented the code in method unlock() and I booked flights.
Then my connection object have locks.
Then I closed the GUI (this calls close() that I commented it because it releases all the locks of this owner)
...unreferenced is never called...
My exam is on tuesday

aarrrrrrghhhhhhhhhhhhhh stupid valus!!!
while typing this post I saw this output in my server!!!
xxxremoving a lock : 9
xxxremoving a lock : 12
then the problem is where I am setting the leasevalue and stuff!! its is taking 15 minutes!!!
ok ok i will be back with more input
[ January 03, 2003: Message edited by: Daniela Ch ]
Daniela Ch
Ranch Hand

Joined: Dec 13, 2002
Posts: 96
Do this work on windows 2000?
System.setProperty("java.rmi.dgc.leaseValue","60000");
System.setProperty("sun.rmi.dgc.checkInterval", "30000");
?
he is ignoring them, he is still taking 15 minutes to call unreferenced...
I have them in the main of my server...
dani
[ January 03, 2003: Message edited by: Daniela Ch ]
Rene Larsen
Ranch Hand

Joined: Oct 12, 2001
Posts: 1179

Originally posted by Daniela Ch:

Then I closed the GUI (this calls close() that I commented it because it releases all the locks of this owner)

What does you 'close()' method do - I hope it is not close of Data you are calling, because then you can not have only one instance of Data - witch you should have i remote mode.
One thing you could try is to disable the call to 'close()' too.
One more thing - the default release time for is 10 min., and the 'auto' release of locks is not part of the assagnment.

Rene
[ January 03, 2003: Message edited by: Rene Larsen ]
Daniela Ch
Ranch Hand

Joined: Dec 13, 2002
Posts: 96
hi rene
the close have two behaviors, depending on the mode
in local mode it close the data faile
in remote mode it release the locks (in case there is but I am not sure this will ever be the case)
It seem that I cant set the leasevalue and the checkvalue to smaller values....si i guess i will keep it to the defaults...
can anyone tell me if he was able to set them to other values? if yes, where was the System.setproperty code?
and like you said, it was not in the requirement in the first place so what I did is enough...
thank you
[ January 03, 2003: Message edited by: Daniela Ch ]
Aruna Raghavan
Ranch Hand

Joined: May 14, 2002
Posts: 194
Changing the leasevalue does work for me.


Aruna A. Raghavan<br />SCJP, SCJD, SCWCD
 
jQuery in Action, 2nd edition
 
subject: leaseValue