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

Moderator: admin

Post Reply
gurpreet_asrgndu
Posts: 55
Joined: Thu Jan 03, 2013 7:51 am
Contact:

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

Post by gurpreet_asrgndu » Mon Jul 15, 2013 3:12 pm

the explanation that you gave for first option(for onMessage) cant that explanation apply to lifecycle callback interceptor methods ?? why ?

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

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

Post by sanju.ait@gmail.com » Sat Aug 24, 2013 1:57 am

Seems like we can throw application exception from life cycle callback interceptors also the same way thrown by onMessage method.

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

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

Post by admin » Sun Aug 25, 2013 10:11 am

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

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

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

Post by sanju.ait@gmail.com » Tue Aug 27, 2013 9:28 am

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?

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

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

Post by admin » Tue Aug 27, 2013 9:47 am

In your example MyEx is an application exception. @ApplicationException is not required if the exception is a checked exception.

HTH,
Paul.
If you like our products and services, please help us by posting your review here.


amaebi
Posts: 4
Joined: Wed Jul 02, 2014 2:00 am
Contact:

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

Post by amaebi » Sun Aug 24, 2014 6:25 pm

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

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

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

Post by admin » Sun Aug 24, 2014 7:41 pm

Amaebi, it is a valid answer.
If you like our products and services, please help us by posting your review here.

ramy6_1
Posts: 124
Joined: Wed Feb 12, 2014 2:44 am
Contact:

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

Post by ramy6_1 » Mon Dec 29, 2014 9:39 am

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.

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

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

Post by admin » Mon Dec 29, 2014 1:31 pm

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

supafly
Posts: 12
Joined: Mon Apr 18, 2016 2:05 pm
Contact:

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

Post by supafly » Thu Dec 29, 2016 6:52 am

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

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests