4 Replies Latest reply on Oct 9, 2003 7:57 AM by cmcromwell

    MDB newInstance() call in JBoss

    cmcromwell

      Hi

      I am wondering when JBoss container for Message-Driven Beans decides when the newInstance() call is made. I need to be able to have my MDB's ejbCreate() called before a meesage is in the queue. That is when it seems JBoss makes the call to initialize the MDB for the first time. Is there any configuration I can adjust to JBoss to have the newInstace() called on deploy of my MDB?

      Thanks for any feed back Chad

        • 1. Re: MDB newInstance() call in JBoss

          AFAIK, it's not possible. But it's maybe a stupid design contraint. Why do you need to create your MDB before a message is posted.

          The JBoss container handles the cache and the pool. You cannot act on it (meaning it may instantiate further MDBs if load is too high for instance)

          Regards,

          Stephane

          • 2. Re: MDB newInstance() call in JBoss
            cmcromwell

            Well. I was trying to do some threading to an Oracle db that would get the message I wanted stored in the queue, that was put into the database by another program and then start the JMS queue and add the message into the queue that 'this' MDB was listening on.

            But because of this constraint I will just make the Thread class that I was using to do this work a service MBean and at configuration time have the program be kick off by a person using the console.

            Thanks for your help :)
            Chad

            • 3. Re: MDB newInstance() call in JBoss

              Looks like you didn't understood MDBs are *stateless*. There is not 'this' notion in MDB.

              Regards,

              Stephane

              • 4. Re: MDB newInstance() call in JBoss
                cmcromwell

                Yes I know that MDB are stateless I was using the 'this' to explain that I wanted to use ejbCreate as a way to send the message to the queue that the same MDB was listening on. not in the java keyword sense.

                Chad