2 Replies Latest reply on Feb 13, 2012 1:12 PM by jaikiran

    EJB business methods invoked by @Timeout (same bean) not intercepted

    guidbona

      Hi,

      it seems that EJB business methods invoked from @Timeout in the same bean are not intercepted.

      Also, @Asynchronous methods invoked from @Timeout are not executed asynchronously.

      All of this happens only to methods belongin to the same bean as @Timeout. If the @Timeout method invokes business methods belonging to a different bean everything is Ok.

       

      Here is an example:

       

       

      @Stateless

      public class TimedBean {

          @Timeout

          public void timeout() {

              asyncMethod();

          }

       

          @Asynchronous

          public void asyncMethod() {

              // ...

          }

      }

       

       

      By the way, stepping with the debugger in asyncMethod() I saw that timeout() is calling it immediately, as if it wasn't a business method.

       

      I've created a test case for this at https://github.com/guidbona/jboss-as/commits/timer-selfinvoke. The tests correctly fail.