Resource Dispensers

Resource dispensers are part of the Microsoft Transaction Server (MTS) programming model and run-time environment. Application components use resource dispensers to access shared information.

A resource dispenser can be any component that is compatible with MTS in a standard way, regardless of the interface that it presents to the user.

The MTS programming model includes declarative transactions, which protect the work performed by an application object during its lifetime. When an application object uses resource dispensers, the work it performs is automatically transactional; that is,the component doesn't have to explicitly declare transactions. These transactions are defined in the OLE Transactions specification, implemented by the Microsoft Distributed Transaction Coordinator (MS DTC), and initiated on behalf of the application object by MTS. See the Resource Managers Guide for more information.

At runtime, dynamic pools of resources are made available to resource dispensers, such as database connections, network connections, connections to queues, threads, objects, and memory blocks. The application process achieves high performance by using a minimum number of frequently used resources.

Resource dispensers are managed by the Resource Dispenser Manager (DispMan). DispMan provides resource pooling for the resource dispensers, and ensures that a resource supplied by a resource dispenser is correctly enlisted in the application object's transaction. DispMan automatically reclaims resources that are still reserved at the end of an object's lifetime, eliminating the possibility of resource "leaks."

DispMan uses the Inventory Statistics Manager to manage pool resource inventory levels. DispMan can request a resource dispenser to create a new resource, or to destroy idle resources when necessary to adjust for inventory levels, rather than using static settings.

A resource dispenser can also function independently of MTS, providing only resource pooling capabilities. When MTS is present, it can automate transactions and reclamation.