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

Moderator: admin

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

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

Post by johnlong »

Or the container may sequence the calls to the same instance one after another. In this case can we say that they are accessed at the the same time?

I think it would be more precise then to say that both client will just get reference(or proxy) to the same bean, but not exactly get bean accessed at the same time.
Two separate clients can call upon a bean method at the same time. You can start two threads and have them execute the same method on the same instance, right?
In our example, let's say bean B invokes bean's A aM() method, will the other bean C able to execute same Am() method, before bean B did not exit the same aM() method or his call will be blocked?
The exact question is : will container create separate threads to allow multithreaded access or container will have to serialize method calls?

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

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

Post by admin »

A "bean" is a logical entity. Reference to a bean doesn't mean reference to a bean class instance. Thus, same "bean" doesn't necessarily mean same bean class instance. So yes, multiple client can invoke calls on the same bean at the same time. Container may either serialize the invocations to the same instance or may create multiple instances. It is up to the container.
If you like our products and services, please help us by posting your review here.

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

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

Post by johnlong »

Specification says:
The container serializes calls to each stateful and stateless session bean instance. Most containers will support many instances of a session bean executing concurrently; however, each instance sees only a serialized sequence of method calls. Therefore, a stateful or stateless session bean does not have to be coded as reentrant.
The container must serialize all the container-invoked callbacks (that is, the business method interceptor methods, lifecycle callback interceptor methods, timeout callback methods, beforeCompletion methods, and so on), and it must serialize these callbacks with the client-invoked business method calls.
By default, clients are allowed to make concurrent calls to a stateful session object and the container is required to serialize such concurrent requests. Note that the container never permits multi-threaded access to the actual stateful session bean instance.

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

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

Post by admin »

Yes. Not sure what is your point. It says the same thing.
If you like our products and services, please help us by posting your review here.

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

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

Post by johnlong »

I think that execute at the same time means multithreaded access.

Post Reply

Who is online

Users browsing this forum: No registered users and 55 guests