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

Moderator: admin

Post Reply
ETS User

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

Post by ETS User »

So by the explanation, if it was a stateless bean, the answer will be the same?

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

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

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

himaiMinh
Posts: 358
Joined: Fri Nov 29, 2013 8:26 pm
Contact:

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

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

costin1989
Posts: 15
Joined: Tue Apr 21, 2015 1:36 am
Contact:

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

Post 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!

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

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

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

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests