Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Handling Client Crash

 
Ramesh kumaar
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,
In order to handle the client crash i implement Unreferenced Interface and override the unreferenced() method. Inside that i try to simply print a statement saying "Unreferenced Method called successfully" which is never called.
While starting the server iam using the following:
java -Djava.rmi.dgc.leaseValue=30000 which will reduce the leaseValue.
The unreferenced method never get called even after 30 minutes. Is there any thing to be done appart from this. Help me.
regards,
rameshkumar
 
Sai Prasad
Ranch Hand
Posts: 560
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think "-Djava.rmi.dgc.leaseValue" is one of the valid server side configuration parameters as per the requirement document. If you don't specifiy this param, unreferenced() will be called in 15 mins.
 
Ramesh kumaar
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Sai,
Ur right i just use -Djava.rmi.dgc.leaseValue=30000 just for testing purpose iam not going to do that for the Exam. I have planned to use System.setPropertie(). But the problem is in my program unreferenced() is never called even after 30 minutes. Please help me
to over come this problem.
regards,
-rameshkumar
 
Sai Prasad
Ranch Hand
Posts: 560
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ramesh, I am not sure. In my case the method was called in 15 mins after I kill the client. Did you shut down the client? Also try with out setting the leasevalue property.
 
BJ Grau
Ranch Hand
Posts: 234
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
After you set leaseValue, also set sun.rmi.dgc.checkInterval to one half of lease value.
Maybe in your situation leaseValue is expiring in 30 seconds, but since it takes 5 minutes for the checkInterval to come around, something is happening to the remote object on the server during that five minutes that precludes it from having unreferenced() called.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic