About stateless session Bean

Discussions

EJB design: About stateless session Bean

  1. About stateless session Bean (4 messages)

    Hi
       As i known,when first client call a stateless session
    bean(thehome.create();thehome.something(),thehome.remove()
    );the container create a stateless session bean(newInstance();setSessionContext;ejbCreate(),something());when
    second client(the same as firt) call a stataless session
    bean,the container only run something() bessiness method.
    it use the bean instance is the same first.

       if many many client call the same stateless session bean
    concurrently,the container use only one stateless session
    bean instance,is it right? or the container create many
    stateless session bean instance to response so many client
     request?

    thanks for ur reply!

    Threaded Messages (4)

  2. About stateless session Bean[ Go to top ]

    The application server can have a pool of stateless session beans and serve the clients requests.
  3. About stateless session Bean[ Go to top ]

    Hai

    In stateless session beans,
    Container will create instance for every request..
    Instances are depending on requests..

  4. About stateless session Bean[ Go to top ]

    Hi Madhu RameshKumar
      "Container will create instance for every request"

    why the ejbCreate() is not invocked when second client
    call thehome.create()?
  5. About stateless session Bean[ Go to top ]

    Actually, Madhu is not exactly correct here. Not all containers will create an instance on invocation of the create on the home. An ejbCreate is only invoked if the Container feels that existing resources are not enough for servicing the client. As far as possible the container tries to invoke the existing resources. Similarly when you invoke remove then the container might not remove the bean at all from memory.

    Shiva.