15.2. Exception handling: philosophy and practice
Exception handling is always important in Java development, and particularly so with EJBs. The EJB Specification devotes a whole chapter [EJB2.0 18] to this topic. This section describes some of the general issues concerning exception handling in EJBs, the more specific issue of the interaction between exception handling and transaction management is covered in Chapter 9.
15.2.1. Review of Java exceptions
In Java, exceptional circumstances are indicated by generating an object of a class that inherits from java.lang.Throwable, and using the throw keyword to pass it out of the method to the caller. The caller can use catch to trap the thrown object, or allow it to be thrown out to its own caller. ...
Get Applied Enterprise JavaBeans™ Technology now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.