Hello ,
In case this question about statless session bean instead of stateful , I think the correct answer will be (1 or 2)
Correct ?
About Question enthuware.oce-ejbd.v6.2.389 :
Moderator: admin
-
- Posts: 124
- Joined: Wed Feb 12, 2014 2:44 am
- Contact:
-
- Site Admin
- Posts: 10036
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.oce-ejbd.v6.2.389 :
Yes, it could be 1 or 2. Because a container is free to create multiple instances of a stateless session bean to service multiple request or it could use just one instance as well.
If you like our products and services, please help us by posting your review here.
-
- Posts: 358
- Joined: Fri Nov 29, 2013 8:26 pm
- Contact:
Re: About Question enthuware.oce-ejbd.v6.2.389 :
On p.82 of JSR-318
So, in this specific scenario, there is only one stateful bean and only one interceptor instance associated with that bean.
That means two clients can call a method of a stateful bean. And the container will handle one client call at a time, (ie, one call after another call).By default, clients are allowed to make concurrent calls to a stateful session object and the container is required to serialize such concurrent request....
So, in this specific scenario, there is only one stateful bean and only one interceptor instance associated with that bean.
-
- Site Admin
- Posts: 10036
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.oce-ejbd.v6.2.389 :
You are misinterpreting the specification. The statement that you have quoted is talking about a client making multiple concurrent calls on the same bean. Two different clients cannot use the same stateful bean. Two different clients will get two references to two different instances of the bean. If the container uses the same stateful bean instance for the two clients, the state of the bean will be messed up. For example, if one client calls method m1, another clients calls m1, and them first client calls m2, then the first client will expect the state of the bean based on its initial call to m1 but that has been messed up by another clients call to m2.
If you like our products and services, please help us by posting your review here.
Who is online
Users browsing this forum: No registered users and 29 guests