users@glassfish.java.net

EJB _at_Asynchronous method is invoked synchronously when called within the same class

From: Theodor Richard <theodor.richard_at_googlemail.com>
Date: Fri, 6 Aug 2010 10:51:24 +0200

Hello folks,

I have the following stateless session bean:

@Stateless
@LocalBean
public class Bean {
    @Asynchronous
    public void methodA(){
        // do something...
    }

    @Timeout
    public void methodB(Timer timer) {
       methodA();
    }
}

When I call methodA from outside the bean, it is invoked asynchronously (as
expected). However, when methodA is called from methodB, it is invoked
synchronously. Any explanation for that? I couldn't find anything
@Asynchronous section of the spec.

Thanks,
Theo