• 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:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Question about server error handling

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In the "Marking" part on my assignement document, they said they will give score for server error handling, but I can not find any thing special for server to do the error handling. I only catch all the IO or DB exception, new RemoteException and throw them out. In the client side, I catch all exception, for all the exception, I show a message box and then System.exit().
Is it OK or I need do something more?
Thank for any suggestion.
 
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
For the most part, yes. But waht about an exception that occurs when you start up the server. No client has started, so who is it supposed to forward these exceptions too? Let alone if there was many clients, which client gets that error?
So you need the same solution as the client side for the server side for exceptions that occur on the server side, so on that side also have a Message that pops up telling the user the error.
Mark
 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For the most part, yes. But waht about an exception that occurs when you start up the server. No client has started, so who is it supposed to forward these exceptions too? Let alone if there was many clients, which client gets that error?
Hi Mark,
Can you give me more detail about it. I really
don't catch you.
 
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 hao,
I think what Mark is trying to say is there are errors that are specific to the server and errors that are specific to individual clients. For example on server startup a BindException or maybe even MalformedURLException could be thrown. If there were a tricky bug on the client that occasionally creates a poorly formed record for modify and causes a DatabaseException to be thrown, you certainly wouldn't want every connected client to receive that exception.
Hope this helps,
Michael Morris
 
hao li
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If there were a tricky bug on the client that occasionally creates a poorly formed record for modify and causes a DatabaseException to be thrown, you certainly wouldn't want every connected client to receive that exception.
But in my design, every client has its own remote
database object using singleton pattern, It seems
a DatabaseException of one client will not affect
the other cleint. Is it right?
 
Michael Morris
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 Hao,


But in my design, every client has its own remote
database object using singleton pattern, It seems
a DatabaseException of one client will not affect
the other cleint. Is it right?


Yep. As long as each client has its own connection object, then RMI will marshall all the exceptions and send them to that client.
Michael Morris
 
reply
    Bookmark Topic Watch Topic
  • New Topic