Chapter 10. Exceptions in EJB: When beans go bad

image with no caption

Expect the unexpected. Despite your best efforts, things can go wrong. Terribly, tragically, wrong. You need to protect yourself. Others depend on you. You can’t let your entire program collapse, just because one bean in the family throws an exception. The application must go on. You can’t prevent tragedy, but you can prepare for it. You need to know what is and is not recoverable, and who is responsible when a problem occurs. Should the Bean Provider tell the Container there’s still hope? Should the Container tell the client to try again? Or should the Container cut its losses, kill the bean, and let the Sys Admin sort it out later...

Get Head First EJB 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.