tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Blevins <david.blev...@visi.com>
Subject Re: @Asynchronous not working for me
Date Wed, 20 Jan 2010 21:38:52 GMT
Hi Luis,

This is one area of EJB 3.1 we don't have implemented yet.  I just  
finished creating a road map of EJB 3.1 features to help the  
development along.  Here it is for reference:

   http://cwiki.apache.org/OPENEJB/ejb-31-roadmap.html

Contribution is welcome as always :)

-David


On Jan 18, 2010, at 1:43 PM, Luis Fernando Planella Gonzalez wrote:

> Hi.
> 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:
> @Stateless
> public class ReportExecutionServiceBean extends BaseServiceBean  
> implements ReportExecutionServiceLocal {
>    @EJB
>    private AsyncReportExecutor reportExecutor;
>
>    public ReportVO runReport(ReportExecutionParameters  
> reportParameters) {
>        reportId = ... //... code omitted
>        reportExecutor.executeReport(reportId, reportParameters);
>        return ... ; // code omitted
>    }
> }
>
> *** Async bean interface:
> public interface AsyncReportExecutor {
>    @Asynchronous
>    Future<Report> executeReport(Long reportId,  
> ReportExecutionParameters reportParameters);
> }
>
> *** Async bean implementation
> @Stateless
> public class AsyncReportExecutorBean extends BaseServiceBean  
> implements AsyncReportExecutor {
>    @Asynchronous
>    public Future<Report> executeReport(Long reportId,  
> ReportExecutionParameters reportParameters) {
> 	// ... code omitted
>        return new AsyncResult<Report>(report);
>    }
> }
>
>
> --
> Luis Fernando Planella Gonzalez
>


Mime
View raw message