users@glassfish.java.net

singleton mdb

From: <glassfish_at_javadesktop.org>
Date: Fri, 06 Aug 2010 07:14:30 PDT

Hi,

we need a single mdb instance which is never destroyed but listens as long as the server is running. Instance thereby means one class instance.

We tried this by deploying the MDB with:

                        <bean-pool>
                                <steady-pool-size>1</steady-pool-size>
                                <resize-quantity>0</resize-quantity>
                                <max-pool-size>1</max-pool-size>
                                <pool-idle-timeout-in-seconds>0</pool-idle-timeout-in-seconds>
                        </bean-pool>

But this doesn't has the required result.
The server creates one mdb instance but as soon as a message arrives in the queue a new mdb is created and destroyed after the message is processed:

TotalBeansDestroyed 1 count -- Number of beans destroyed from the associated pool
NumBeansInPool 1 High Water Mark: 1 count
                                        Low Water Mark: 0 count
TotalBeansCreated 2 count -- Number of beans created in the associated pool

I thought pool-idle-timeout-in-seconds = 0 would force the server to never remove a idle bean and max-pool-size = would ensure there is only one bean in the pool.

So why does the container creates a new instance when a message arrives and how can we prevent it. We use version GlassFish v3 (build 74.2).

Thanks for any idea
Petra
[Message sent by forum member 'petraleomue']

http://forums.java.net/jive/thread.jspa?messageID=479502