users@jax-rs-spec.java.net

[jax-rs-spec users] Re: Asynchronous EJBs

From: Santiago Pericas-Geertsen <Santiago.PericasGeertsen_at_oracle.com>
Date: Thu, 28 Feb 2013 10:25:07 -0500

On Feb 27, 2013, at 5:09 PM, Arun Gupta <arun.p.gupta_at_oracle.com> wrote:

> "continues processing the invocation on a separate thread of execution" will be true for the entire method execution and thus executeLongRunningOp and ar.resume will run in one thread.

 Yes, exactly.

> What makes sure that executeLongRunningOp runs in a separate thread ?

 Nothing, where did you get the idea that *only* executeLongRunningOp runs in separate thread?

> Would also like clarification on Future vs void return type.

 We can't prevent you from using Future, but I don't think we do anything special with it.

-- Santiago

> On 2/27/13 4:47 PM, Santiago Pericas-Geertsen wrote:
>>
>> On Feb 27, 2013, at 4:13 PM, Arun Gupta <arun.p.gupta_at_oracle.com> wrote:
>>
>>> Asynchronous EJBs can have method signature with "void" and "Future" return type. Section 8.3 describes the behavior with "void" return type. Is "Future" return type not permitted ?
>>>
>>> If permitted, how would the response be returned back to the client ?
>>>
>>> EJB spec says
>>>
>>> " When a client invokes an asynchronous method, the container returns control to the client immediately and continues processing the invocation on a separate thread of execution. "
>>>
>>> The code sample indicates only executeLongRunningOp will run in a separate thread and ar.resume in the application thread. How is that expected to work ?
>>
>> What lead you to that conclusion? The execution of longRunningOp is completely done in another thread, so the calls to executeLongRunningOp and ar.resume are done on the that same thread.
>>
>> -- Santiago
>>
>>
>
> --
> http://twitter.com/arungupta
> http://blogs.oracle.com/arungupta