The better place to put EJB Initialization code - Weblogic

This is a discussion on The better place to put EJB Initialization code - Weblogic ; I have some stateless session beans that need to be initialied from a few sources to set some internal variabes. Where would be the best place to put this code. In the ejbCreate , in a default constructor, or in ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: The better place to put EJB Initialization code

  1. The better place to put EJB Initialization code


    I have some stateless session beans that need to be initialied from a few sources
    to set
    some internal variabes. Where would be the best place to put this code.
    In the ejbCreate , in a default constructor, or in the setSessionContext method.

    Thanks.

  2. Re: The better place to put EJB Initialization code

    They're all roughly equivalent.

    When the container wants to create a new slsb instance, it will call the
    ctor, setSessionContext, and ejbCreate in that order.

    FWIW, setting initial-beans-in-free-pool to > 0 will instruct the
    container to precreate instances if you're looking to do that as well.

    -- Rob


    Tim Bounds wrote:
    > I have some stateless session beans that need to be initialied from a few sources
    > to set
    > some internal variabes. Where would be the best place to put this code.
    > In the ejbCreate , in a default constructor, or in the setSessionContext method.
    >
    > Thanks.



  3. Re: The better place to put EJB Initialization code


    Thanks.

    Rob Woollen wrote:
    >They're all roughly equivalent.
    >
    >When the container wants to create a new slsb instance, it will call
    >the
    >ctor, setSessionContext, and ejbCreate in that order.
    >
    >FWIW, setting initial-beans-in-free-pool to > 0 will instruct the
    >container to precreate instances if you're looking to do that as well.
    >
    >-- Rob
    >
    >
    >Tim Bounds wrote:
    >> I have some stateless session beans that need to be initialied from

    >a few sources
    >> to set
    >> some internal variabes. Where would be the best place to put this

    >code.
    >> In the ejbCreate , in a default constructor, or in the setSessionContext

    >method.
    >>
    >> Thanks.

    >



+ Reply to Thread