tags:

views:

32

answers:

1

Is there a way to pre-load EJB instances (stateless) in JBoss 4.2.0? I know there isn't any configuration option for this, but could I write my own MBean or something to do this?

-Dave

A: 

It's probably not neccessary according to this article

in $JBOSS_HOME/server/default/conf/standardjboss.xml you find

<container-pool-conf>
        <MaximumSize>100</MaximumSize>
</container-pool-conf>

for both container-confgiurations Clustered Stateless SessionBean and

Standard Stateless SessionBean

Looking in the DTD shows MinimumSize as an optional element in container configuration for experimenting you could set the MinimumSize and check whether some server code cars about.

<!--
  The container-pool-conf element holds configuration data for the
  instance pool.
  jboss does not read directly the subtree for this element: instead,
  it is passed to the instance pool instance (if it implements
  org.jboss.metadata.XmlLoadable) for it to load its parameters.

  The default instance pools, EntityInstancePool and
  StatelessSessionInstancePool, both accept the following configuration.

  Used in: container-configuration
-->
<!ELEMENT container-pool-conf ((MinimumSize?, MaximumSize?,
   strictMaximumSize?, strictTimeout?) | Synchronized)>
stacker
It looks like that won't work.http://docs.jboss.org/jbossas/admindevel326/html/ch5.chapter.html"All current JBoss InstancePool implementations derive from the org.jboss.ejb.plugins.AbstractInstancePool class and it provides support for the MinimumSize, MaximumSize, strictMaximumSize and strictTimeout container-pool-conf child elements. The MinimumSize element gives the minimum number of instances to keep in the pool, although JBoss does not currently seed an InstancePool to the MinimumSize value."
Dave