tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Luis Fernando Planella Gonzalez <>
Subject @Asynchronous not working for me
Date Mon, 18 Jan 2010 12:43:10 GMT
I'm trying to create an asynchronous method invocation using the @Asynchronous annotation.
However, I'm always having the execution in the same thread as the caller bean.
What could be wrong here? I've tried to put the @Asynchronous in all combinations: interface
only, impl only, both, and no luck.

Here's the code:

*** Client code:
public class ReportExecutionServiceBean extends BaseServiceBean implements ReportExecutionServiceLocal
    private AsyncReportExecutor reportExecutor;

    public ReportVO runReport(ReportExecutionParameters reportParameters) {
        reportId = ... //... code omitted
        reportExecutor.executeReport(reportId, reportParameters);
        return ... ; // code omitted

*** Async bean interface:
public interface AsyncReportExecutor {
    Future<Report> executeReport(Long reportId, ReportExecutionParameters reportParameters);

*** Async bean implementation
public class AsyncReportExecutorBean extends BaseServiceBean implements AsyncReportExecutor
    public Future<Report> executeReport(Long reportId, ReportExecutionParameters reportParameters)
	// ... code omitted
        return new AsyncResult<Report>(report);

Luis Fernando Planella Gonzalez

View raw message