• 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

HELP - Larry the rodent bites

 
Ranch Hand
Posts: 194
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I've designed a nice Connection Server, which is registered with a well-known address and dishes out a remote Data Access object to everyone who asks its getConnection() method. And all this works fine...
I donated my ConnectionServer a command that prints out the current number of active connections. And this works fine, too - and helped me to see the following problem: If Larry the rodent and his kumpel Rudi bite the cable (or - what has the same effect -if the user presses Ctrl-C to kill the VM whein which the client is running), the remote DataAccess object does not say good-bye.
So, if my application is running for a longer time, and if the users are not well-behaved (they do not take the exit door but simply kill the VM to leave their clients), then my server is getting congested with shadow DataAccess objects that no longer have a counterpart at the other end of the line.
Here are some solutions I can think of:
  • Don't do anything about this (no hear - no see - no speak).
  • Tell the users they must no use Ctrl-C on the VM, and in case they do, they should tell the Systems Admin (or alternatively let the examiner know that you are aware of this problem but you did not implement a solution for it)
  • Have the connection polling the client whether it's still alive (uaarrgh)
  • Do not let the client have a connection but let it send Joblets to the server (quite elegant).
  • I've also checked custom sockets - but this would only help to implement the polling solution.


  • Any comments on how to address this problem in the context of the SCJD exam is welcomed!!!
     
    Ranch Hand
    Posts: 3451
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Hi Mag,
    Or just implement Unreferenced.
    Michael Morris
     
    Mag Hoehme
    Ranch Hand
    Posts: 194
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Thank you Michael -
    unreferenced did help.
    reply
      Bookmark Topic Watch Topic
    • New Topic