Use eclipselink.exception-handler
to specify the EclipseLink exception handler class: a Java class that implements the org.eclipse.persistence.exceptions.ExceptionHandler
interface and provides a default (zero-argument) constructor.
Values
Table 5-34 describes this persistence property's values.
Table 5-34 Valid Values for exception-handler
Value | Description |
---|---|
|
Use the
|
Usage
The ExceptionHandler
class name must be fully qualified by its package name.
Examples
Example 5-22 shows how to use this persistence property extension in the persistence.xml
file.
Example 5-22 Using exception-handler in persistence.xml
<property name="eclipselink.exception-handler" value="my.package.MyExceptionHandler">
Example 5-23 shows how to use this extension in a property map
Example 5-23 Using exception-handler in a Property Map
import org.eclipse.persistence.config.PersistenceUnitProperties;propertiesMap.put(PersistenceUnitProperties.EXCEPTION_HANDLER_CLASS, "my.package.MyExceptionHandler");
See Also
For more information, see:
"Sessions" in Understanding EclipseLink
"Managing and Diagnosing Problems" in Solutions Guide for EclispeLink