Just a bit of background on EJB3.1 exceptions before bringing up my question -
Application exceptions comprise of
User defined checked or unchecked exceptions which have @ApplicationException annotation
All checked exceptions
java.lang.Exception & it's subclass exceptions
except java.rmi.RemoteException & it's subclass exceptions
System exceptions comprise of
java.rmi.RemoteException and it's subclass exceptions
All unchecked exceptions
java.lang.RuntimeException and it's subclass exceptions
java.lang.Error and it's subclass exceptions
Below is a statement I have read in this book
In EJB System exceptions are not excepted by the client, when encountered such exceptions are not passed to the client as is but are wrapaped in a javax.ejb.EJBException.
My questions -
Also from this question:
An application exception shall be thrown when there is a business-logic error, as opposed to a system error.
There is an important difference: application exceptions do not automatically cause a transaction to rollback. The client has an opportunity to recover after an application exception is thrown.
Application exceptions are sent to the client without being repackaged as an EJBException. Therefore, you can use them to report validation errors or business logic problems, and they will reach the client.
javax.ejb.EJBException
extends RuntimeException
so yes, it is a System Exception.Common scenario associated with this: if you've got an uncaught RuntimeException
in your application code it will roll-back. It's pretty useful default behavior.