2 Replies Latest reply on May 14, 2003 7:16 AM by dmaclaren

    Multithreading

    sysuser1

      Hello,

      I have a session EJB where one of its methods needs to call the same function (with different parameters) several times and this function takes a long time because it's associated to a web service. So the typical "for" loop is not a good idea.

      I'd like something like multithreading (in order to do all the invocations without waiting for the end of the previous invocation) but I know that it's discouraged by the EJB specification.

      Is there any way to simulate the multithreading and get these objectives?.

      I know that there are other alternatives like JMS or a callback (the web service client calls the WS server and then the WS server behaves like a WS client to return the response), but I don't like both of them.

      All ideas will be welcome.

        • 1. Re: Multithreading
          dmaclaren

          You can make RMI call. You could also have a call to another VM, or have a STD class make the threading happen. Try to push off to a Servlet container. If you are running thhe servlet container and the application container in the same VM, you can make use of the Local interfaces of EJB2.0 to speed things up as well as the message beans.

          • 2. Re: Multithreading
            dmaclaren

            I sould not cont on the callback option as it opens up too many issues that will not make it worth while.