[jboss-jira] [JBoss JIRA] Resolved: (EJBTHREE-2190) JBOSS 6M5, EJB 3.1 Asynchronous method not running Asynchronously
Carlo de Wolf (JIRA)
jira-events at lists.jboss.org
Wed Oct 27 17:29:54 EDT 2010
[ https://jira.jboss.org/browse/EJBTHREE-2190?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Carlo de Wolf resolved EJBTHREE-2190.
-------------------------------------
Resolution: Duplicate Issue
> JBOSS 6M5, EJB 3.1 Asynchronous method not running Asynchronously
> -----------------------------------------------------------------
>
> Key: EJBTHREE-2190
> URL: https://jira.jboss.org/browse/EJBTHREE-2190
> Project: EJB 3.0
> Issue Type: Bug
> Environment: Red hat linux 5.5 & solaris 10 (SPARC) jboss6-M5 java 1.6.0_22
> Reporter: Jamie Blake
>
> Annotated EJB 3.1 @Asynchronous method not running asynchronously.
> Created simple Java EE project, depoyed to both glassfish 3.0.1 and jboss 6-M5.
> Glassfish appears to run asynchronously, jboss seems to block on the call and wait for the method to execute.
> Here is the simple code example:
> package com.syncme;
>
> import javax.ejb.Local;
>
> @Local
> public interface TestAsynchLocal {
>
> public void methodAsynchronous();
> public void methodNonAsynchronous();
> }
> package com.syncme;
>
> import java.util.logging.Level;
> import java.util.logging.Logger;
> import javax.annotation.Resource;
> import javax.ejb.Asynchronous;
> import javax.ejb.SessionContext;
> import javax.ejb.Stateless;
>
> @Stateless
> public class TestAsynch implements TestAsynchLocal {
>
> @Resource
> SessionContext sctx;
> @Asynchronous
> public void methodAsynchronous() {
> try {
> System.out.println("methodAsynchronous starting");
> Thread.sleep(10000);
> System.out.println("methodAsynchronous done");
> } catch (InterruptedException ex) {
> Logger.getLogger(TestAsynch.class.getName()).log(Level.SEVERE, null, ex);
> }
>
> }
>
> public void methodNonAsynchronous() {
> System.out.println("methodNonAsynchronous starting");
>
> TestAsynchLocal localAsynch = sctx.getBusinessObject(TestAsynchLocal.class);
>
> localAsynch.methodAsynchronous();
> System.out.println("methodNonAsynchronous done");
>
> }
> }
>
>
> Call from web:
> package com.wbean;
>
> import com.syncme.TestAsynchLocal;
> import javax.ejb.EJB;
> import javax.faces.bean.ManagedBean;
> import javax.faces.bean.SessionScoped;
>
> @ManagedBean(name="jsfmanbean")
> @SessionScoped
> public class NewJSFManagedBean {
> @EJB
> private TestAsynchLocal testAsynch;
>
> /** Creates a new instance of NewJSFManagedBean */
> public NewJSFManagedBean() {
> }
>
> public String Next() {
> return "NEXT";
> }
>
>
>
> public void RunLong() {
>
> testAsynch.methodNonAsynchronous();
>
> }
>
> }
>
>
> Here are the outputs:
> Jboss 6M5 run:
>
> 17:51:40,803 INFO [STDOUT] methodNonAsynchronous starting
> 17:51:40,804 INFO [STDOUT] methodAsynchronous starting
> 17:51:50,805 INFO [STDOUT] methodAsynchronous done
> 17:51:50,805 INFO [STDOUT] methodNonAsynchronous done
>
> Glassfish 3.0.1 run:
> INFO: methodNonAsynchronous starting
> INFO: methodNonAsynchronous done
> INFO: methodAsynchronous starting
> INFO: methodAsynchronous done
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list