-
1. Re: EJB Async
wolfc Sep 30, 2011 2:18 PM (in response to paul.setzermann)Can you be a bit more precise how it is not working for you?
Do you get an exception?
Is the invocation synchronous? If so, how did you verify?
-
2. Re: EJB Async
paul.setzermann Sep 30, 2011 3:41 PM (in response to wolfc)The method is invoked synchronously.
When I check the a4j:log it´s always waiting for the asynch method to complete.
My code looks like this:
... <a4j:commandButton action="#{updateAdbBean.update()}" value="Start" execute="@form" /> ... @ManagedBean @SessionScoped public class UpdateAdbBean implements Serializable { private static final long serialVersionUID = 2778548975359198879L; ... public void update() { ... FillOrUpdateAdbManager fillOrUpdateAdbManager = lookup(FillOrUpdateAdbManager.class); System.out.println("BEFORE"); fillOrUpdateAdbManager.fillOrUpdate(true, updateAdbView.getSource(), adbSpecies, progressBean); System.out.println("AFTER!!!"); ... } } @Stateless @Asynchronous public class FillOrUpdateAdbManager { @Asynchronous public void fillOrUpdate(boolean bUpdate, String source, ADBSpecies species, ProgressBean progressBean) { try { TimeUnit.SECONDS.sleep(10); } catch (InterruptedException e) { e.printStackTrace(); } } }
Thanks and Cheers,
Paul
-
3. Re: EJB Async
jadtn Oct 1, 2011 5:12 AM (in response to paul.setzermann)Hi
I ve same problem
The code is synchronous, not asynchronous
@Singleton
@Asynchronous
public class AsyncBean {
@Asynchronous
public void ignoreResult(int a, int b) {
System.out.println("slepp...");
try {
Thread.sleep(5000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
System.out.println("fin sleep");
// the client doesn't care what happens here
}
}
-
4. Re: EJB Async
morphy Oct 3, 2011 4:51 AM (in response to paul.setzermann)jboss 7.0.2 supports only ejb 3.1 light which do not have the asynch call as you can see here http://www.theserverside.com/news/1321142/Part-Three-New-Features-in-EJB-31 (look at the table... Table 1: EJB and EJB Lite Feature Comparison)
look also here
https://docs.jboss.org/author/display/AS7/Getting+Started+Guide
where you can find the profile's stack both for specs and for jb 7.0.x
bye
-
5. Re: EJB Async
paul.setzermann Oct 3, 2011 5:01 AM (in response to morphy)Hey Riccardo,
Thanks for your help, but why is this stated in the release information?
ANKÜNDIGUNG: AS 7.0.2.Final "Arc" released!
A month after 7.0.1.Final was released, we now have 7.0.2! The binary downloads are available here. 7.0.2 "Arc" is mainly a bug fix release but also brings some new features and improvments:
- JSF 2.1
- Async EJB support!!
- Resurrected -b option for command line binding
- SSO support
- JNDI memory footprint improvement
- Limited support for Hibernate 3.3
Cheers,
Paul
-
6. Re: EJB Async
wolfc Oct 3, 2011 5:16 AM (in response to paul.setzermann)Can you add some println statements to both
UpdateAdbBean.
update
andFillOrUpdateAdbManager.
fillOrUpdate
?Specifically:
System.err.println(Thread.currentThread());
also add:
new Exception("here").printStackTrace();
tofillOrUpdate.
It should show two different threads and a trace which is running in the asynchronous executor service.
-
7. Re: EJB Async
morphy Oct 3, 2011 5:18 AM (in response to paul.setzermann)maybe a documental bug or in the RN or in the user guide... it's hard to think a bug in the specifications... they are specifications and they say no async call for ejb light...
with the distribution you should have the *-preview.xml which is the full jee stack (as far as i've understood), so we can assume a bug in the user guide (no ejb light in the full stack but full ejb)
so try with that standalone/domain configuration
and share
bye
-
8. Re: EJB Async
morphy Oct 3, 2011 5:19 AM (in response to wolfc)@Carlo
Hi, are you telling us that the jboss implementation of ejb light supports async calls?
-
9. Re: EJB Async
wolfc Oct 3, 2011 5:31 AM (in response to morphy)1 of 1 people found this helpfulNo, good catch.
The default configuration is only lite enabled:
<subsystem xmlns="urn:jboss:domain:ejb3:1.1" lite="true">
Which in turn does not have async support.
Try:
$ ./standalone.sh --server-config standalone-preview.xml
-
10. Re: EJB Async
jaikiran Oct 3, 2011 5:41 AM (in response to morphy)The announcement in this forum has now been edited to make it a bit more clear that the async EJB support is available in the standalone-preview configuration of "everything" distribution.