About Question enthuware.oce-ejbd.v6.2.452 :

Moderator: admin

Post Reply
sanju.ait@gmail.com
Posts: 38
Joined: Fri Aug 16, 2013 11:37 pm
Contact:

About Question enthuware.oce-ejbd.v6.2.452 :

Post by sanju.ait@gmail.com »

MyException is not annotated with @ApplicationException.
Than how it is Application Exception?

admin
Site Admin
Posts: 10046
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.oce-ejbd.v6.2.452 :

Post by admin »

Any checked exception is considered an application exception.
If you like our products and services, please help us by posting your review here.

IndoKnight
Posts: 9
Joined: Thu Feb 27, 2014 11:47 am
Contact:

Re: About Question enthuware.oce-ejbd.v6.2.452 :

Post by IndoKnight »

When used in no transaction context, does this mean @ApplicationException annotation only makes sense when used to define run time exceptions?

himaiMinh
Posts: 358
Joined: Fri Nov 29, 2013 8:26 pm
Contact:

Re: About Question enthuware.oce-ejbd.v6.2.452 :

Post 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.

admin
Site Admin
Posts: 10046
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.oce-ejbd.v6.2.452 :

Post by admin »

What do you mean by "non-recoverable"?
If you like our products and services, please help us by posting your review here.

himaiMinh
Posts: 358
Joined: Fri Nov 29, 2013 8:26 pm
Contact:

Re: About Question enthuware.oce-ejbd.v6.2.452 :

Post 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.

himaiMinh
Posts: 358
Joined: Fri Nov 29, 2013 8:26 pm
Contact:

Re: About Question enthuware.oce-ejbd.v6.2.452 :

Post 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

admin
Site Admin
Posts: 10046
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.oce-ejbd.v6.2.452 :

Post 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.
If you like our products and services, please help us by posting your review here.

Post Reply

Who is online

Users browsing this forum: No registered users and 51 guests