-
1. Re: Using @Asynchronous in JBoss 7
jaikiran Apr 5, 2012 5:14 AM (in response to bryan.solan)Bryan Solan wrote:
public String getMyResult() { ... getMyResultSubroutine(); ... }
You are doing a plain Java call from getMyResult to getMyResultSubroutine() method. That won' introduce any EJB semantics to the call. See this on how to get it working https://community.jboss.org/message/525521#525521
-
2. Re: Using @Asynchronous in JBoss 7
sfcoy Apr 5, 2012 5:19 AM (in response to bryan.solan)1 of 1 people found this helpfulFrom the EJB 3.1 Spec §4.5.1
Asynchronous method invocation semantics only apply to the no-interface, Local business, and Remote business client views.
In other words, you have to invoke the @Asynchronous method from an external bean reference:
{code:java}
class MyClient {
@EJB
private
TestAsyncBean
testBean;... someMethod(...) {
...
testBean.getMyResultSubroutine();
...
}
}
{code}
This is because the EJB machinery needs the opportunity to invoke the method through a proxy. I've used the no-interface view above, but you could also use your interface if the method was declared on it.