Chapter 8 Creating J2EE Applications for BEA WebLogic
WebLogic Server uses a free pool to improve performance and throughput for stateless session and message driven EJBs. The free pool stores unbound stateless session EJBs. Unbound EJBs are instances of a stateless session EJB class that are not processing a method call.
The following figure illustrates the WebLogic Server free pool, and the processes by which stateless EJBs enter and leave the pool. Dotted lines indicate the "state" of the EJB from the perspective of WebLogic Server.
By default, no EJB instances exist in the WebLogic Server at startup. As clients access individual beans, WebLogic Server initializes new instances of the EJB class.
You can optionally set the initial-beans-in-free-pool property in weblogic-ejb-jar.xml to automatically create unbound EJBs in the free pool during startup. This can improve initial response time when accessing EJBs, because initial client requests can be satisfied by activating the bean from the free pool (rather than initializing the bean and then activating it). By default, initial-beans-in-free-pool is set to 0.
Note that the maximum size of the free pool is limited either by available memory, or the value of the max-beans-in-free-pool deployment element.
When a client calls a method on a stateless EJB, WebLogic Server obtains an instance from the free pool. The EJB remains active for the duration of the client's method call. After the method completes, the EJB is returned to the free pool. Because WebLogic Server unbinds stateless session beans from clients after each method call, the actual bean class instance that a client uses may be different from invocation to invocation.
If all instances of an EJB class are active and max-beans-in-free-pool has been reached, new clients requesting the EJB class will be blocked until an active EJB completes a method call. If the transaction times out (or, for non-transactional calls, five minutes elapse), WebLogic Server throws a RemoteException.
Copyright (C) 2005. Sybase Inc. All rights reserved. |
![]() |