Page 1 of 1

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

Posted: Sun Jan 20, 2013 12:25 pm
by ETS User
So by the explanation, if it was a stateless bean, the answer will be the same?

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

Posted: Sun Jan 20, 2013 3:28 pm
by admin
No, as the explanation says, for a stateless bean it is possible that a container has multiple instances of the bean. But that is not guaranteed. So for a stateless bean, the answer will depend on how may instances are there and which instance is used to service the method calls.

HTH,
Paul.

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

Posted: Sun May 10, 2015 5:13 pm
by himaiMinh
If the next question is for stateless bean,
3 possible answers:
1) r1.getData () and r2.getData() will be B A if r1 and r2 are two different instances.
2) r1.getData() and r2.getData() will be B B if r1 and r2 are refering to the same instance.
3) r1.getData() returns B while r2.getData() may return something else if r2 is an existing instance which has data set to something else by another client.

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

Posted: Sat Mar 19, 2016 11:03 am
by costin1989
These beans expose remote interfaces or not? the names indicate they are remote so the call r1.setData("B"); will have no effect over r1 reference, so they will both print A A

It is true that nowhere is shown @Remote annotations, so we should consider them local beans?

thanks!

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

Posted: Sat Mar 19, 2016 9:13 pm
by admin
Whether the beans are remote or local is irrelevant here. In both the cases the answer will be B, A (not A, A) as explained in the explanation.