• Post Reply Bookmark Topic Watch Topic
  • New Topic

Removing UnicastRemoteObject from a Hashmap takes ages

 
Jared Cope
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have this problem where a UnicastRemoteObject takes ages to be removed from a Hashmap if the client computer that the UnicastRemoteObject represents is not contactable. Below is some code from the server program:



client is a UnicastRemoteObject and topupJobs is a HashMap. What I would like to happen is for the topupJobs.remove(client) line to execute quickly regardless of whether the client is contactable or not.

I don't know why it would try to establish communication with the client computer before being removed from the collection.

Eventually after the 15 minutes I get an exception such as the following:


Any ideas and interpretations are welcome.

Cheers, Jared.
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out the Sun RMI FAQ - entries D5 through D8 are about distributed garbage collection and leases.

When the "remove" method returns - a remote reference to the client will be de-referenced. If the client crashed, it will have to wait for it's lease to time out before failing. Though 15 minutes does seem longer than usual for a timeout...
 
Jared Cope
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Nathan Pruett:
[QB]Check out the Sun RMI FAQ - entries D5 through D8 are about distributed garbage collection and leases.
[QB]


Thanks, I think that explains what's going on very well.

Cheers, Jared.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!