5.4. Exception Classes

JDO defines a set of exception classes that a JDO runtime can throw. The exceptions are all runtime exceptions because they can occur whenever an in-memory persistent object is accessed, not just when a JDO method is invoked. The classes are divided into fatal and non-fatal exceptions. Refer to Figure 5-3 for the JDO exception class hierarchy.

A JDO exception behaves the same as a normal Java runtime exception; however, in addition to an error string, a JDO exception may also have a reference to the persistent object to which the exception relates. For operations that process more than one persistent object (a commit, for example), a JDO exception contains an array of nested exceptions, one for each persistent object that ...

Get Core Java™ Data Objects now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.