0 Replies Latest reply on Jul 20, 2011 5:23 AM by ilya40umov

    EJB bean method timeout

    ilya40umov

      Hello everyone!

       

      Does anyone know how I can achieve the following behavior from EJB?

      I want the container terminate some of the methods of my EJB beans by timeout. I want it just to rallback the transaction and throw an TimeOutException right when method execution takes longer than some specified time but I can't find any ways to do it in EJB.

      P.S. The only option which comes to mind is about running a separate thread and terminating it by calling stop method/by using stop-flag inside the thread etc. But I'm afraid that this solution smells very bad and can affect scalability and the other things we want to achieve using EJB.

       

      Thanks and Regards,

      Ilya