OLE DB resource pooling, also known as OLE DB session
pooling, is handled by the OLE DB core components. To take advantage of
resource pooling, an OLE DB consumer must invoke the data provider by using
either the
IDataInitialize or the
IDBPromptInitialize interface. (ActiveX Data Objects [ADO] attempts to do this
automatically). OLE DB resource pooling can be set ON for one provider and set
OFF for another.
This article describes a behavioral change from MDAC
2.0 to MDAC 2.1. By default MDAC 2.0 sets session pooling OFF and MDAC 2.1 or
later by default sets the session pooling ON.
By default, service components are enabled for all
Microsoft OLE DB providers if the provider is invoked by either
IDataInitialize or
IDBPromptInitialize and if the provider is marked to work with pooling by using the
OLEDB_Services registry key.
You can control pooling from your
application in the following three ways:
- You can disable pooling for an individual provider through
the registry.
- If you write directly to the OLE DB API, you can control
pooling through the properties you set when connecting to the database.
- You can control pooling from your connection string.
The Connection Pooling time-out (CPTIMEOUT) value is set to 60
seconds; this value cannot be configured in OLE DB resource pooling prior to
the release of MDAC 2.5.
In MDAC 2.0 (including all service packs)
the
OLEDB_SERVICES registry key under the specific provider is set to 0xfffffffc,
which means that no session pooling is available.
Starting with MDAC
2.1 (including all service packs) the
OLEDB_SERVICES registry key is set to 0xffffffff, meaning session pooling is
ON.
For example, SQLOLEDB is the native OLEDB provider for SQL
Server. If you install MDAC 2.0 on your computer you will see that
OLEDB_SERVICES under
HKEY_CLASSES_ROOT\CLSID\{0C7FF16C-38E3-11d0-97AB-00C04FC2AD98} in the registry
contains 0xfffffffc. On the other hand, if you have installed MDAC 2.1 or later
the same entry contains 0xffffffff.
For more information, see the following: