JDBC  «Prev 

JDBC Resource drain

If you are worried about the resource drain involved in each servlet hanging onto a database connection at all times, you might prefer to get those connections just before you need them, and let go immediately afterwards.

Instance pooling

Instance pooling allows a single component instance to service multiple clients. The component lifecycle contains activation and deactivation steps: Activation binds an instance to an individual client; deactivation indicates that the instance is unbound. Instance pooling eliminates resource drain from repeated allocation of component instances.

Supporting instance pooling in your component

Instance pooling eliminates resource drain caused by repeated allocation of new component instances.
For Java components, you can implement a lifecycle-control interface to control whether the component instances are pooled. These interfaces also provide activate and deactivate methods that are called to indicate state transitions in a component instance’s lifetime. For more information on these interfaces, see the following sections:
Java components can implement the interface
jaguar.beans.enterprise.ServerBean.

To support instance pooling, code that responds to activation events must restore the component to its initial state (that is, as if it were newly created). The Java interface has methods that allow an instance to selectively refuse pooling: canReuse in Java. When the component Pooling option is set in EJB Server, the Java canReuse method is not called, even if the component implements the ServerBean Java interface.

Connection pooling is a technique used for reusing and sharing Connection objects among requesting clients.