Stateless EJB Pool Not Initialized Immediately After Its Application is Loaded in Oracle Glassfish Server (Doc ID 1333192.1)

Last updated on NOVEMBER 05, 2016

Applies to:

Oracle GlassFish Server - Version: 2.1 to 2.1.1 - Release: 2.1 to 2.1
Information in this document applies to any platform.

Symptoms

Both Stateless Session Beans (EJB) and Message Driven Beans are resources that are pooled within the Application Server, and those pooled instances used as needed. The pool configuration can be set by editing the Global configuration in the "EJB Container Pool" and setting the appropriate minimum (steady) and maximum pool sizes.

The issue seen is that the stateless EJB or MDB instance are not created until the first EJB request is received. If no request is present to trigger a EJB execution, no EJB instance will be created even if the EJB settings have set a steady bean pool size of non zero. For certain application use-cases where EJB instance creation takes a long time, it is preferable to have the EJB instances created in the EJB pool at application start up instead of during the first request.

You may check the server log to see if you are running into this scenario. The following is an example where it takes 10 minutes for "MDBWithConcurrentProcessing" message-driven bean to appear in the log file after it has been invoked.

[#|2010-08-06T16:56:07.351-0700|INFO|sun-appserver2.1|com.stc.jmsjca.core.Activation|_ThreadID=67;_ThreadName=JMSJCA connect;|JMSJCA-E015: [cc-QueueReceiver(lookup://jms/myConcurrentQueue) @ [mq://localhost:7676]]: message delivery initiation was successful.|#]
[#|2010-08-06T17:06:06.705-0700|INFO|sun-appserver2.1|com.foo.MDBWithConcurrentProcessing|_ThreadID=62;_ThreadName=p: thread-pool-1; w: 5;|In MDBWithConcurrentProcessing constructor...|#]

Changes

The Tuning the EJB Container section of the Glassfish Performance Tuning Guide describes the EJB pooling and the individual meaning of these settings, as well as how to configure the EJB pool per EJB component using an application's sun-ejb-jar.xml deployment descriptor file.

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms