I've the following situation:
I wish the "methodB" was executed 10 times paralleling. But it only happening when the "methodB" is called from another bean.
Why the annotation "@Asynchronous" does not work when the method is called from another method in the same class?
Thanks.
It only works for methods call via a client proxy, for example a @Local
or @Remote
interface. This is described in the EJB 3.1 specs (section 4.5 - 4.5.1):
A session bean can expose methods with asynchronous client invocation semantics
...
The @Asynchronous annotation is used to designate which business methods are asynchronous.
...
Asynchronous method invocation semantics only apply to the no-interface, Local business, and Remote business client views.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With