-
1. Re: Asynchronous methods doesn't run asynchronously :(
kapitanpetko Jul 14, 2010 3:32 AM (in response to idyoshin)How are you getting an instance of RezervScheduler in your REST-service?
-
2. Re: Asynchronous methods doesn't run asynchronously :(
idyoshin Jul 14, 2010 6:03 AM (in response to idyoshin)Via seam injection @In(value="rezervScheduler", create=true)
-
3. Re: Asynchronous methods doesn't run asynchronously :(
jeanluc Jul 14, 2010 11:23 AM (in response to idyoshin)I found in practice that calls to @Asynchronous code in the same class are shortcut and executed synchronously, even if the reference to the target object is obtained through Seam (injection or Component.getInstance()). This would have been expected if the methods were just invoked from the same instance, but not when the reference is obtained so that Seam's proxies are used.
If methodA has to call methodB asynchronously, I had to put them in separate classes.
-
4. Re: Asynchronous methods doesn't run asynchronously :(
kapitanpetko Jul 14, 2010 9:25 PM (in response to idyoshin)
Ilya Dyoshin wrote on Jul 14, 2010 06:03:
Via seam injection @In(value="rezervScheduler", create=true)Well, in that case, either you components.xml is not set up correctly or the AsynchronousInterceptor is not being invoked. If your RezervScheduler is in an EJB jar, check you have set up the Seam interceptor correctly. If all fails, set a break point in AcynchronousInterceptor.aroundInvoke or simply examine the stack when cache is being called to see what is happening.
Btw, don't mix @Transactional and @TransactionalAttribute. Since your component is an EJB, just use @TransactionalAttribute.
HTH