Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

NX Contractors: Handling deadlocks from client crashes

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've read through some of the older topics and have a HUGE headache now. Can someone explain the best way to do this?
I don't understand completely how to use the Unreferenced interface. If there are 2 clients with references to the remote object, but client A crashes, then Unreferenced still wouldn't be called because client B still has a reference to it (the remote object), right? So what's the point? Or is my understanding completely wrong?
Also, to use WeakHashMap you need to keep the thread name as a key right? Well then if I put the record number as the value, where do I store the freakin' cookie? Or do I have to create another class just to put the recNo and cookie as the value to the WeakHashMap?
Damn, what a headache I have...
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"If there are 2 clients with references to the remote object"
That is where you have your headache. In the design of your Application, you need to have only one client to one remote object. So that is that client crashes Unreferenced will be called. This one to one relationship is what we refer to here as the "Connection" object design.
Do a search on this forum for Connection and you will find a plethora of posts.
Good Luck.
Mark
 
town drunk
( and author)
Posts: 4118
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Ramses Tutoli:

Also, to use WeakHashMap you need to keep the thread name as a key right?


No! There's a detailed explanation of all of this. Search for my posts regarding same.
All best,
M
 
Ramses Tutoli
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Mark, when I search for "Connection" I get about 1000 hits of unrelated topics. It's too general. I'm only confused because I thought there was only one remote object, and all clients have to connect through it.
Max, I will try to do that, thanks. Do you have any specific threads you are referring to?
 
The City calls upon her steadfast protectors. Now for a tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic