A large, complex system have N-tiers. How to handle the exceptions, such as the connection from Application Server
to database is broken or session is lost, is a big issue for designer and architect to consider. How should we
process, depend on the application server, or depend on the database to handle it? Please share your experience.
Thanks
Discussions
EJB programming & troubleshooting: Exception process: focus on Application Server or on Databse?
-
Exception process: focus on Application Server or on Databse? (3 messages)
- Posted by: tiger ceo
- Posted on: July 21 2001 20:29 EDT
Threaded Messages (3)
- Exception process: focus on Application Server or on Databse? by Rick Grashel on July 23 2001 12:10 EDT
- Exception process: focus on Application Server or on Databse? by tiger ceo on July 23 2001 18:12 EDT
- Exception process: focus on Application Server or on Databse? by Rick Grashel on July 24 2001 09:05 EDT
- Exception process: focus on Application Server or on Databse? by tiger ceo on July 23 2001 18:12 EDT
-
Exception process: focus on Application Server or on Databse?[ Go to top ]
- Posted by: Rick Grashel
- Posted on: July 23 2001 12:10 EDT
- in response to tiger ceo
Tiger,
You'll get different answers to this question. A lot depends upon personal experience. But its a good question.
For me, I prefer to extend Exception and create my own Exception class. With a custom-built exception class, you are able to define your own error-messaging charateristics. As you do QA testing, it also helps you to define areas in your application that need to have additional exception handling. In my opinion, no part of your application should ever throw _native_ Java exceptions.
With the custom exception class, you should also have a class which defines 'user-friendly', context-sensitive error messages. These messages, you can display back to the user.
For debugging purposes, in a log file (I highly recommend log4j) you should store the full stack trace of the internal exception.
That's about all I can think of!
Good luck!
-- Rick
-
Exception process: focus on Application Server or on Databse?[ Go to top ]
- Posted by: tiger ceo
- Posted on: July 23 2001 18:12 EDT
- in response to Rick Grashel
Hi Rick,
Thanks. Then you mean that you mainly depends on the application server' handling exception ability, and don't consider on the database area? -
Exception process: focus on Application Server or on Databse?[ Go to top ]
- Posted by: Rick Grashel
- Posted on: July 24 2001 09:05 EDT
- in response to tiger ceo
Tiger,
You should also handle all database exceptions and rewrap them with your own custom exception, as well.
try
{
...
}
catch (SQLException sqle)
{
throw new MyException(sqle);
}
Or something to that nature.
Regards,
Rick