Page 1 of 1
About Question enthuware.oce-ejbd.v6.2.452 :
Posted: Tue Aug 27, 2013 11:33 am
by sanju.ait@gmail.com
MyException is not annotated with @ApplicationException.
Than how it is Application Exception?
Re: About Question enthuware.oce-ejbd.v6.2.452 :
Posted: Tue Aug 27, 2013 12:54 pm
by admin
Any checked exception is considered an application exception.
Re: About Question enthuware.oce-ejbd.v6.2.452 :
Posted: Sun Mar 02, 2014 8:28 am
by IndoKnight
When used in no transaction context, does this mean @ApplicationException annotation only makes sense when used to define run time exceptions?
Re: About Question enthuware.oce-ejbd.v6.2.452 :
Posted: Mon May 11, 2015 6:19 pm
by himaiMinh
Regarding to the last option :
The client will get EJBException that wraps MyException
This option may be true if MyException is non-recoverable.
Checked exception can be non-recoverable just like unchecked exception.
Re: About Question enthuware.oce-ejbd.v6.2.452 :
Posted: Mon May 11, 2015 8:01 pm
by admin
What do you mean by "non-recoverable"?
Re: About Question enthuware.oce-ejbd.v6.2.452 :
Posted: Tue May 12, 2015 10:16 am
by himaiMinh
According to Frits' notes, p.58:
if the EJB method performs an operation that results in a checked exception that the bean method cannot recover, the bean method should throw the EJBException that wraps the original exception.
I've not figured out what kind of checked exceptions that cannot be recovered yet.
Re: About Question enthuware.oce-ejbd.v6.2.452 :
Posted: Tue May 12, 2015 11:03 am
by himaiMinh
Actually, this quote comes from the spec on p. 383:
If the bean method performs an operation that results in a checked exception[76] that the bean method cannot recover, the bean method should throw the javax.ejb.EJBException that wraps the original exception
Re: About Question enthuware.oce-ejbd.v6.2.452 :
Posted: Tue May 12, 2015 7:50 pm
by admin
Ok, that is on programmer's discretion. If the programmer thinks that there is no point in continuing further upon receiving a checked exception then he can wrap it into an EJBException. This is same as the bean throwing an EJBException in other cases. The container will discard the bean.