3 Replies Latest reply on Mar 21, 2003 3:04 AM by Andrew

    Stateless Session Beans and Threads

    Andrew Newbie

      Dear all,

      I am developing an application that has 2 SLSBs. Sometimes these beans run in the same thread sometimes in different threads. Does anyone know what the rules are for this. I've looked in the JBOSS documentation and also the EJB spec, but I can't find the answer.

      Thanks in advance,
      Andy

        • 1. Re: Stateless Session Beans and Threads
          Adrian Brock Master

          You'll have to state more clearly what you are
          trying to achieve.
          The spec makes no guarantees about which threads
          an invocation runs on. In fact it
          forbids ejbs from doing anything with threads.

          Regards,
          Adrian

          • 2. Re: Stateless Session Beans and Threads
            Andrew Newbie

            I'll explain a bit more about my application. My SLSBs connect to an object-oriented database (Versant). The SSLBs connect via a Data Access Object. There can only be one DAO per thread (enforced by the database) - this is how I know the SSLBs sometimes start in the same or different threads.
            I had originally presumed (wrongly) that each SLSB would start in a different thread.
            I'm not trying to spawn any new threads from within the bean - I know you are forbidden from doing this. What I would like to know is the rules for how JBOSS deals with multithreading of beans.

            Regards,
            Andy

            • 3. Re: Stateless Session Beans and Threads
              Andrew Newbie

              I'll explain a bit more about my application. My SLSBs connect to an object-oriented database (Versant). The SSLBs connect via a Data Access Object. There can only be one DAO per thread (enforced by the database) - this is how I know the SSLBs sometimes start in the same or different threads.
              I had originally presumed (wrongly) that each SLSB would start in a different thread.
              I'm not trying to spawn any new threads from within the bean - I know you are forbidden from doing this. What I would like to know is the rules for how JBOSS deals with multithreading of beans.

              Regards,
              Andy