The JPA spec differentiates between system exceptions and application exceptions. I am a bit confused about where the line is drawn exactly. My guesstimate:
An application exception is an exception that your code or libraries used by your code throw, explicitly or implicitly.
- Does this include all exceptions, runtime and checked regardless the source?
A system exception is probably an exception thrown by the persistence provider. It certainly contains all subclasses of javax.persistence.PersistenceException
.
- What about other exceptions thrown by provider code?
- What about exceptions thrown by other Java EE libraries?
- Does it make a difference if the exception is wrapped in an
EJBException
?
How can I influence the behaviour by using the ApplicationException annotation? I have never seen it being used yet.
See Question&Answers more detail:os