About Question enthuware.oce-jpad.v6.2.405 :

Moderator: admin

Post Reply
lveto15
Posts: 27
Joined: Tue Sep 22, 2015 1:01 pm
Contact:

Re: About Question enthuware.oce-jpad.v6.2.405 :

Post by lveto15 » Sat Apr 23, 2016 11:57 am

Have problem with this question. Selected answer is correct according to specification per se (in abstract situation).

In this case, question mentions that
system exceptions are not caught anywhere in the code
, thus exception recieves in bean A is propagated to client, which doesn't catch it. So, client is interrupted and its transation is not finished correctly. Client could continue but didn't use this option, so better answer is "None of the above".

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

Re: About Question enthuware.oce-jpad.v6.2.405 :

Post by admin » Sun Apr 24, 2016 9:04 pm

The client can have a finally or even a shutdown hook that can commit the transaction. Therefore, even if the client doesn't catch the exception, it still can continue with that transaction.

The point here is that on the client side, its transaction is not doomed.

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

__JJ__
Posts: 125
Joined: Thu Jul 05, 2018 6:44 pm
Contact:

Re: About Question enthuware.oce-jpad.v6.2.405 :

Post by __JJ__ » Sat Sep 22, 2018 10:30 pm

There is no impact on bean B instance.
Why is this? Is it because the bean B method in some way "never got going"? I thought when a method was called on a session bean and it blows up (i.e the exception isn't handled and propagates to the caller, which in this case is bean A) it gets destroyed, simple as that. I haven't studied EJB (yet), seeing as it's a different exam, so please could you elaborate a little on why bean B doesn't get destroyed, when in so many other questions of type "client calls bean A, bean A calls bean B, bean B throws some kind of exception" bean B gets destroyed.

Thanks.

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

Re: About Question enthuware.oce-jpad.v6.2.405 :

Post by admin » Sat Sep 22, 2018 11:34 pm

Correct. Bean B was never invoked. It never threw an exception to the container. The container threw an exception to A on its own.
If you like our products and services, please help us by posting your review here.

__JJ__
Posts: 125
Joined: Thu Jul 05, 2018 6:44 pm
Contact:

Re: About Question enthuware.oce-jpad.v6.2.405 :

Post by __JJ__ » Sun Sep 23, 2018 11:34 am

OK I see, thanks very much.

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 2 guests