|
|
|
Object Pooling
Object pooling is an automatic service provided by COM+ that enables you to configure a component so that instances of it are kept active in a pool, ready to be used by any client that requests the component. You can administratively configure and monitor the pool maintained for a given component, specifying characteristics such as pool size and creation request timeout values. Once the application is running, COM+ manages the pool for you, handling the details of object activation and reuse according to the criteria you have specified. When you configure a component to be pooled, COM+ will maintain instances of it in a pool, ready to be activated for any client requesting the component. Any object creation requests will be handled through the pool manager. When the application starts, the pool will be populated up to the minimum level that you have administratively specified, so long as object creation succeeds. As client requests for the component come in, they are satisfied on a first-come, first-served basis from the pool. If no pooled objects are available, and the pool is not yet at its specified maximum level, a new object is created and activated for the client. When the pool reaches its maximum level, client requests are queued, and will receive the first available object from the pool. The number of objects, both activated and deactivated, will never exceed the maximum pool value. Whenever possible, COM+ will attempt to reuse an object once a client releases it, until the pool reaches its maximum level. The object is responsible for monitoring its own state to determine whether it can be reused, and should return an appropriate value for IObjectControl::CanBePooled . When a pooled object is created, it is aggregated into a larger object that will manage the object's lifetime. The outer object calls methods on IObjectControl at appropriate times in the object's lifecycle
|
|