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

Moderator: admin

Post Reply
andreiribas
Posts: 5
Joined: Wed Jul 18, 2012 9:02 am
Contact:

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

Post by andreiribas »

I didn't understand the answer for this question.

The explanation is below:

Call from regularM1Int() to asyncM1FutureInt() is a regular method call and it will go to the same object. It is not brokered by the container and the asynchronous semantics will not apply here. Therefore, time taken by the client call to return will be directly affected by the time taken by the asynchronous method to finish. In this case, the client call will not return until at least 10 seconds.

--

Why it's a regular method call?
Why it isn't brokered by the container? Because the caller of the async method is the same object?

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

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

Post by admin »

If you observe the caller code, it is not using any special EJB handle (such as a reference injected by the container or acquired from the JNDI name space) to call the method. It is using 'this'. Therefore, it is just a regular method call.

Code: Select all

 public int regularM1Int() {
        asyncM1FutureInt();  <--- Observe this invocation
        return 303;
    }
If you like our products and services, please help us by posting your review here.

evefuji
Posts: 21
Joined: Fri Apr 11, 2014 8:57 pm
Contact:

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

Post by evefuji »

Exists the possibility of on InterruptedException be called? (Example: timeout of bean methods execution)

In this case, how I can call the method in asynchronous context but using same bean?

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

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

Post by admin »

evefuji wrote:Exists the possibility of on InterruptedException be called? (Example: timeout of bean methods execution)

In this case, how I can call the method in asynchronous context but using same bean?
You can't. As per the state transition diagram in Section 3.6.6, If the bean times out, it goes to "Does not exist" state.

HTH,
Paul.
If you like our products and services, please help us by posting your review here.

jhonsoda
Posts: 3
Joined: Tue Jul 21, 2015 7:44 pm
Contact:

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

Post by jhonsoda »

I was wondering, If the asyncrhonous method asyncM1FutureInt is called by a bussiness interface (@Local or @Remote), would the following choices be correct?

* The client call will not return for at least 10 seconds.
* Time of sleep in the asynchronous method will NOT affect the time that the client call will take to return.

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

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

Post by admin »

It doesn't matter who invokes an async method. What matters is how is it invoked. If you invoke it through an EJB handle (given to you by the container), then the call will return immediately irrespective of how long the method sleeps inside.
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 21 guests