Enterprise JavaBeans™ Component Architecture: Designing and Coding Enterprise Applications
by Gail Anderson, Paul Anderson
Using Exceptions with EJBs
The J2EE architecture provides for the detection and handling of exceptions. There are two kinds of exceptions: system exceptions and application exceptions. Application exceptions indicate recoverable-type problems (for example, bad user input or a requested purchase item being unavailable). The EJB container propagates application exceptions to the remote client, who presumably will have a catch handler in place to correct the problem (if possible) or take evasive action. The NoTrackListException shown in Listing 4.3 on page 95 is an example of an application exception. Application exceptions should be subclasses of Exception.
System exceptions indicate nonrecoverable errors, such as a lost database connection or ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access