I try to get an async process running. Based on this example: http://tomee.apache.org/examples-trunk/async-methods/README.html
But the method addWorkflow(Workflow
So the normal way would be to have the @Asynchronous method in another bean from the caller method.
@Stateless
public class ComputationProcessor {
@Asynchronous
public Future performComputation {
return new AsyncResult(null);
}
}
@Stateless
public class ComputationService {
@Inject
private ComputationProcessor mProcessor;
public void ...() {
Future result = mProcessor.performComputation();
...
}
}
As you discovered, it won't work if the @Asynchronous method is in the same bean than the caller.