0 Replies Latest reply on Feb 23, 2015 7:54 AM by Jaroslav Simak

    MDB application - how often get the constructor called?

    Jaroslav Simak Newbie


        I have an MDB application. When I look in to the log file, I see that the constructor of the MDB get called for each incoming message.

        Well, I expected that the constructor get called once when the MDB is created and later only onMessage method is called.

        The MDB goes to a pool after finishing the job and comes out of the pool when needed (without necessity to call the constructor).



        But I see following in the log file:

        grep 'The constructor of mdb was executed' myapp.log | wc -l




        I printed some runtime statistics, too  



                        "ejb3" => {

                          "entity-bean" => undefined,

                          "message-driven-bean" => {"MyMDB" => {

                              "component-class-name" => "MyMDB",

                              "declared-roles" => [],

                              "delivery-active" => true,

                              "execution-time" => 1242733L,

                              "invocations" => 1997L,

                              "methods" => {"onMessage" => {

                                  "execution-time" => 1242733L,

                                  "invocations" => 1997L,

                                  "wait-time" => 9563L


                              "peak-concurrent-invocations" => 10L,

                              "pool-available-count" => 40,

                              "pool-create-count" => 10,

                              "pool-current-size" => 10,

                              "pool-max-size" => 40,

                              "pool-name" => "mdb-strict-max-pool",

                              "pool-remove-count" => 0,

                              "run-as-role" => undefined,

                              "security-domain" => "other",

                              "timers" => [],

                              "wait-time" => 9563L,

                              "service" => undefined



        There is obviously a pool and the MDB are is use, but the constructor get called as well.

        Am I totally wrong, or did I missed something in the configuration?

        Maybe you might help me and explain the issue, thanks


        I use Wildfly 8.1