Page 1 of 1

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

Posted: Thu Mar 20, 2014 7:30 am
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?

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

Posted: Thu Mar 20, 2014 9:37 am
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;
    }

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

Posted: Thu Apr 24, 2014 9:26 pm
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?

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

Posted: Sat Apr 26, 2014 10:24 am
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.

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

Posted: Wed Sep 30, 2015 3:11 pm
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.

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

Posted: Thu Oct 01, 2015 12:28 am
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.