Page 1 of 1

About Question enthuware.oce-ejbd.v6.2.389 and enthuware.oce-ejbd.v6.2.391 :

Posted: Sun Jun 17, 2012 5:31 pm
by ETS User
Hello,

In the question of the Quik diagnostic test:
You have associated an interceptor class with a stateless session bean method. If this method is called once by two different clients, how many instances of the interceptor class will be created?

- it is explain that the right answer is ----- "Can“t say "


On the Test 4, the last question:

You have associated an interceptor class containing an AroundInvoke method with a stateless session bean method. If this method is called once by two different clients, how many distinct instances of the interceptor class will be used to service these two calls?

- here it is explain that the right answer is ------- "1 or 2"


Please explain way not the same answer on both questions.
Thanks a lot.

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

Posted: Mon Jun 18, 2012 6:05 am
by admin
The answers are different because if you read both the questions carefully, you will notice that 2.389 asks how many instances will be created, and the answer is can't say because that depends on how many instances of the bean are created by the container (because of pooling). A container could any number of instances of a stateless session bean.

While 2.391 asks, how many instances will be used. In this case, the answer is 1 or 2 depending which instance the method calls are routed to. Since there are two calls made, at most 2 different instances can be used.

HTH,
Paul.

Re: About Question enthuware.oce-ejbd.v6.2.389 and enthuware.oce-ejbd.v6.2.391 :

Posted: Sun Jun 23, 2013 8:10 am
by fred flintstone
The explanation of question 2.389 is that two instances of interceptor classes will be created:
The life cycle of an interceptor is same as that of the bean. One unique instance of interceptor is associated with one unique instance of a bean. Interceptor instances are not shared among the bean instances. Since instances of a stateful sessions beans are never shared (each client gets its own instance), there will be two instances of interceptor class as well.
It is comprehensible that there will be two instances of interceptor classes, because the question refers to stateful session beans. But the correct answer is "Can't say". Isn't it a contradiction?

Thanks
Fred

Re: About Question enthuware.oce-ejbd.v6.2.389 and enthuware.oce-ejbd.v6.2.391 :

Posted: Sun Jun 23, 2013 11:30 am
by admin
You are right. This has now been fixed.

thank you for your feedback!