4 Replies Latest reply on Dec 22, 2004 9:31 AM by eztrip

    populating method-ready pool on deployment

    eztrip

      Hi -

      Is there any way to tell JBoss to call newInstance() on my MDB's as soon as they are deployed? My MDB's have some reasonably significant startup costs associated with them and I would like to have the pool partially populated so that the intial requests don't take forever. I tried setting

      <MinimumSize>25</MinimumSize>
      in standardjboss.xml but the MDB's still didn't get instantiated.

      Thanks for any help.
      Mike

        • 1. Re: populating method-ready pool on deployment
          darranl

          You shouldn't be putting code into the constructors of your EJB components.

          • 2. Re: populating method-ready pool on deployment
            eztrip

            Looking back at my post I didn't say that I put code in my constructors. I'm not sure what you're saying??

            I'm putting code in my ejbCreate() which where initialization code rightly belongs. When the container creates an instance of an MDB, ejbCreate() is called and what I want to happen is have the container instantiate a set number of MDB instances before messages start flowing through the system.

            That's my question.

            Mike

            • 3. Re: populating method-ready pool on deployment
              darranl

               

              Looking back at my post I didn't say that I put code in my constructors. I'm not sure what you're saying??


              Is there any way to tell JBoss to call newInstance() on my MDB's as soon as they are deployed?


              That is where I am getting that you have code in the constructor, newInstance is just calling the constructor nothing else - calling setMessageDrivenContext and calling ejbCreate are additional steps that occur any time later before the bean is first used.

              The EJB pools do not have a mechanism to fill to the minimum, the value specified is used by JBoss to prevent the instances from being removed and taking the number in the pool below the minimum.

              • 4. Re: populating method-ready pool on deployment
                eztrip

                sorry - my bad. I was assuming that it was understood in my poorly phrased post that the "container" calls newInstance() which is what happens first. Anyway, thank you for the info on how the Pools work.

                Mike