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

Moderator: admin

Post Reply
mopuffus
Posts: 22
Joined: Thu Jul 25, 2013 3:39 pm
Contact:

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

Post by mopuffus »

IMHO the Stateless bean does not have to implement the setSessionContext method.
If this is correct then the container needs to call only:
constructor, postConstruct, bussinesMethod and preDestroy.

My test claims that the upper listed method flow is wrong but I think it is not.

Best Regards,
Mihai

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

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

Post by admin »

Actually, a bean does not need to implement @PostConstruct or @PreDestroy either. But the question is just trying to illustrate the sequence of all these calls assuming the bean has these methods.

HTH,
Paul.

mopuffus
Posts: 22
Joined: Thu Jul 25, 2013 3:39 pm
Contact:

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

Post by mopuffus »

I agree with you and the question is good because it make you think over the entire methods flow.

On the other side the "setSessionContext" is a 2.1 remaining :).

vinkjrwl
Posts: 7
Joined: Sat Feb 08, 2014 8:30 pm
Contact:

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

Post by vinkjrwl »

Hi,
Remember that a stateless session bean does not have ejbActivate and ejbPassivate methods.
Choices given contains @prePassivate and @postActivate and not ejbActivate and ejbPassivate as given in the explanation.

keeping the options given in mind, following order should also be a valid answer to this question:

@PostConstruct
businessMethod
@prePassivate
@postActivate
@preDestroy

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

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

Post by admin »

ejbActivate/ejbPassivate are same as @PostActivate/@PrePassivate. ejbActivate/ejbPassivate methods are declared in SessionBean interface and are invoked by the container upon activation/passivate of a bean that implements SessionBean interface, while the @PostActivate/@PrePassivate are annotations meant for the same purpose.

As noted in the explanation, a Stateless Session bean does not have these methods. So the order you've mentioned is wrong.

HTH,
Paul.

vinkjrwl
Posts: 7
Joined: Sat Feb 08, 2014 8:30 pm
Contact:

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

Post by vinkjrwl »

Thanks Paul. It was kind of stupid on my part to ask this question as I failed to notice the session bean type itself (stateless in the case).

Thanks.

johnlong
Posts: 197
Joined: Mon Jun 20, 2016 5:06 pm
Contact:

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

Post by johnlong »

I am not getting show correct answer option in DnD pop-up screen.

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

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

Post by admin »

If you are in a test, it will be enabled after you finish the test. If not, you need to click on Evaluate first.

johnlong
Posts: 197
Joined: Mon Jun 20, 2016 5:06 pm
Contact:

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

Post by johnlong »

It is not showing after evaluation.

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

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

Post by admin »

Please follow these steps.
test1.png
test1.png (26.26 KiB) Viewed 14669 times

johnlong
Posts: 197
Joined: Mon Jun 20, 2016 5:06 pm
Contact:

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

Post by johnlong »

Please see my screenshot.
Attachments
Screen Shot 2017-06-03 at 08.39.06.png
Screen Shot 2017-06-03 at 08.39.06.png (217.46 KiB) Viewed 13587 times

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

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

Post by admin »

I have made some change to this question to fix the issue.
Could you please download the updated version of the question bank from http://enthuware.com/downloads/ejbplusv6.ets ?

thank you,
Paul.

johnlong
Posts: 197
Joined: Mon Jun 20, 2016 5:06 pm
Contact:

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

Post by johnlong »

Will do, thanks.

Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests