EJB 2.0 Development with WebSphere Studio Application Developer
by Ueli Wahli, Wouter Denayer, Lars Schunk, Deborah Shaddon, Martin Weiss
EJB exception handling
This section describes the basic concepts of exception handling for EJBs. The bean developer must be aware of how different exceptions affect the life cycle of a bean, and when necessary, account for this within the code.
Exceptions allow us to separate error handling code from normal code. We can wrap the code that we expect to execute most of the time with a try, block, and then place error handling code in catch clauses. That is the code that we do not expect to get executed often, if ever.
*New EJB 2.0 - Local exceptions
The exception handling semantics of EJB 2.0 have not changed much since EJB 1.1. The biggest difference in EJB 2.0 exception handling is the introduction of local exceptions for the local component ...
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