Chapter 8 Creating J2EE Applications for BEA WebLogic


Using max-beans-in-free-pool

In general, you should not set the max-beans-in-free-pool element. When you ask the free pool for a bean instance, there are three possible situations that you can encounter. They are as follows:

By default, max-beans-in-free-pool is the Int.max. That does not mean that you will be able to use 2 billion instances. Essentially, it means that Option 3 never happens. If a pooled instance does not exist, you will always just allocate a new one. In reality, you are limited with the number of executable threads. In most cases, each thread will need, at most, a single bean instance.

The only reason to set max-beans-in-free-pool is to limit access to an underlying resource. For example, if you use stateless session EJBs to implement a legacy connection pool, you do not want to allocate more bean instances than the number of connections that can be supported by your legacy system.

Special Use of max-beans-in-free pool

The following options describe special cases when max-beans-in-free-pool can be set to 0:

 


Copyright (C) 2005. Sybase Inc. All rights reserved.