9.3. Application exceptions

The discussion above has centered on JDO exceptions. However, it is also likely that an application will have its own cause to throw and catch domain-specific exceptions. These are referred to as application exceptions.

Application exceptions are designed along with the domain model, although they typically end up in a subpackage of the domain package. Domain objects throw and catch these exceptions according to the modeling of business processes by the designer. Persistent instances are capable of throwing and catching the same exceptions as their transient counterparts. No further effort is required of developers in this regard as a result of using JDO for object persistence.

Get Java™ Data Objects 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.