users@glassfish.java.net

MDB: max-pool-size vs. steady-pool-size; new instance on every message

From: <glassfish_at_javadesktop.org>
Date: Fri, 01 Aug 2008 01:21:00 PDT

Hi,

I have a MDB which should only be there once. So I put the following in sun-ejb-jar.xml:

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

It seems to work fine, i.e. there is really only one instance of the MDB. But what bothers me is that every time a new message comes in, a new MDB instance gets created and destructed, which seems inefficient. I put some logging in the @PostConstruct and @PreDestroy methods to verify this. I thought when using steady-pool-size with a high timeout, there will always be the same instance. How can I achieve this?

Thanks in advance,
Chris
[Message sent by forum member 'chrjohn' (chrjohn)]

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