Freigeben über


Overriding Provider Service Defaults

The provider's registry value for OLEDB_SERVICES is returned as the default value for the DBPROP_INIT_OLEDBSERVICES initialization property on the data source object.

As long as the registry entry exists, the provider's objects will be aggregated and the consumer can override the provider's default setting for enabled services by setting the DBPROP_INIT_OLEDBSERVICES property prior to initialization. To enable or disable a particular service, the consumer will usually get the current value of the DBPROP_INIT_OLEDBSERVICES property, set or clear the bit for the particular property to be enabled or disabled, and reset the property. DBPROP_INIT_OLEDBSERVICES can be set directly in OLE DB or in the connection string passed to ADO or IDataInitialize::GetDatasource.

Performance can be tuned using DBPROPVAL_OS_AGR_AFTERSESSION. When off, aggregation beyond the session level is disabled, resulting in improved performance. The setting is ignored when non?session level services, such as the Client Cursor Engine, are used.

The corresponding values to enable or disable individual services are listed in the following tables. Note that the Client Cursor Engine is excluded; ADO invokes the Client Cursor Engine independent of these OLE DB Services.

Default services enabled

DBPROP_INIT_OLEDBSERVICES

property value

All services (default)

DBPROPVAL_OS_ENABLEALL

All except pooling and automatic transaction enlistment

(DBPROPVAL_OS_ENABLEALL & ~DBPROPVAL_OS_TXNENLISTMENT & ~DBPROPVAL_OS_RESOURCEPOOLING)

All except pooling

(DBPROPVAL_OS_ENABLEALL &

~DBPROPVAL_OS_RESOURCEPOOLING)

All except automatic transaction enlistment

(DBPROPVAL_OS_ENABLEALL &

~DBPROPVAL_OS_TXNENLISTMENT)

All except Client Cursor Engine

(DBPROPVAL_OS_ENABLEALL & ~DBPROPVAL_OS_CLIENTCURSOR)

All except pooling, automatic transaction enlistment, and Client Cursor Engine

(DBPROPVAL_OS_ENABLEALL & ~DBPROPVAL_OS_RESOURCEPOOLING & ~DBPROPVAL_OS_TXNENLISTMENT & ~DBPROPVAL_OS_CLIENTCURSOR)

Pooling and automatic transaction enlistment only, session level aggregation only

DBPROPVAL_OS_TXNENLISTMENT & DBPROPVAL_OS_RESOURCEPOOLING

No services

DBPROPVAL_OS_DISABLEALL

Default services enabled

Value in connection string

All services (default)

"OLE DB Services = -1;"

All except pooling and automatic transaction enlistment

"OLE DB Services = -4;"

All except Client Cursor Engine

"OLE DB Services = -5;"

All except pooling, automatic transaction enlistment, and Client Cursor Engine

"OLE DB Services = -8;"

Pooling and automatic transaction enlistment only, session level aggregation only

"OLE DB Services = 3;"

No services

"OLE DB Services = 0;"

Note

If the registry entry does not exist for the provider, the Component Managers will not aggregate the provider's objects and no services will be enabled, even if explicitly requested by the consumer.