Page 1 of 1

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

Posted: Mon Jul 15, 2013 3:12 pm
by gurpreet_asrgndu
the explanation that you gave for first option(for onMessage) cant that explanation apply to lifecycle callback interceptor methods ?? why ?

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

Posted: Sat Aug 24, 2013 1:57 am
by sanju.ait@gmail.com
Seems like we can throw application exception from life cycle callback interceptors also the same way thrown by onMessage method.

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

Posted: Sun Aug 25, 2013 10:11 am
by admin
Option 1 is talking about MDB while option 3 is talking about all the beans in general. As per section 12.5.1 :
Lifecycle callback interceptor methods may throw system runtime exceptions, but not application exceptions.
HTH,
Paul.

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

Posted: Tue Aug 27, 2013 9:28 am
by sanju.ait@gmail.com
public class MyEx extends IOException{}

Is MyEx is application exception?

Or is it always necessary to annotate it with @ApplicationException to make it application exception?

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

Posted: Tue Aug 27, 2013 9:47 am
by admin
In your example MyEx is an application exception. @ApplicationException is not required if the exception is a checked exception.

HTH,
Paul.

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

Posted: Tue Aug 27, 2013 11:48 am
by sanju.ait@gmail.com
Thanks a lot Paul

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

Posted: Sun Aug 24, 2014 6:25 pm
by amaebi
Since "Session bean business method is allowed to throw system exception." was not a valid answer, I think the option can be amended to "Session bean business method is allowed to [only] throw system exception."

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

Posted: Sun Aug 24, 2014 7:41 pm
by admin
Amaebi, it is a valid answer.

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

Posted: Mon Dec 29, 2014 9:39 am
by ramy6_1
Hello ,

In the second option "Business method interceptor methods may throw runtime exceptions ......"

What this option mean here by business method interceptor methods , please give an example.

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

Posted: Mon Dec 29, 2014 1:31 pm
by admin
You can specify interceptor classes for business methods of a bean. It is talking about methods of those interceptor classes. Please see section 4.3.13 of EJB 3.1 specification for details.

HTH,
Paul.

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

Posted: Thu Dec 29, 2016 6:52 am
by supafly
The explanation to option 4 should mention that in case the business method throws a system exception the bean instance is discarded (if it is not a Singelton).