Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HELP - Larry the rodent bites

 
Mag Hoehme
Ranch Hand
Posts: 194
  • Mark post as helpful
  • send pies
  • 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!!!
     
    Michael Morris
    Ranch Hand
    Posts: 3451
    • Mark post as helpful
    • send pies
    • 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
    • Quote
    • Report post to moderator
    Thank you Michael -
    unreferenced did help.
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic