JBoss Community

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

created by Guido Bonazza in JBoss AS 7 Development - View the full discussion

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.

Reply to this message by going to Community

Start a new discussion in JBoss AS 7 Development at Community