The settings for specific versions of ODP.NET can be configured in several ways for specific effects on precedence:
The Windows registry entries are machine-wide settings for a particular version of ODP.NET.
The machine.config
settings are .NET framework-wide settings that override the Windows registry values.
The application or web config file settings are application-specific settings that override the machine.config
settings and the Windows registry settings.
Any attribute settings that are equivalent to the connection string override everything.
The application or web config file can be useful and sometimes essential in scenarios where more than one application on a computer use the same version of ODP.NET, but each application needs a different ODP.NET configuration. The Windows registry value settings for a given version of ODP.NET affect all the applications that use that version of ODP.NET. However, having ODP.NET configuration values in the application or web config file assure that these settings are applied only for that application, thus providing more granularity.
For example, if the application or web.config
file has a StatementCacheSize
configuration setting of 100
, this application-specific setting forces the version of ODP.NET that is loaded by that application to use 100
for the StatementCacheSize
and overrides any setting in the machine.config
and in the registry. Note that for any setting that does not exist in a config file (machine.config
or application/web config), the value in the registry for a loaded version of ODP.NET is used, as in previous releases.
Note that ODP.NET reads the machine.config
files from the version of the .NET Framework on which ODP.NET runs, not from the version of ODP.NET.
ODP.NET only reads the Windows Registry and the XML configuration file when it is loaded into memory, thus any configuration changes made after that are not read or used until the application is re-started.
ODP.NET supports the configuration of an attribute as follows:
In the Windows registry.
In an XML file.
Through a different mechanism such as a connection string or programmatically through an ODP.NET class, if applicable.
Table 2-1 describes each configurable attribute that is supported by ODP.NET. In the table, the term Configuration Support is followed by the types of configuration support (Windows registry, XML file, and so on) that are available for that attribute.
The table describes valid values as well as the default for each attribute.
Note:
The default values shown are the values used for an attribute if the registry key does not exist or if it is not configured anywhere.Table 2-1 Configuration Attributes
Attribute/Setting Name | Description |
---|---|
|
Specifies whether the status of the connection is checked or not before putting the connection back into the connection pool. This registry entry is not created by the installation of ODP.NET. However, the default value Configuration Support: Windows Registry and XML file Valid Values:
Default: |
|
Specifies the port number which ODP.NET listens to, for all notifications sent by the database for change notification, HA, or RLB features. ODP.NET does not throw any errors if an invalid or used port number is specified. The port can also be set to override the Windows registry and XML configuration file by setting the Configuration Support: XML file, and ODP.NET class Valid Values:
Default: |
|
Specifies whether ODP.NET demands Configuration Support: Windows Registry and XML file Valid Values: 0: Disables demands for 1: Enables demands for Default: 0 |
|
Specifies the location where dependent unmanaged Oracle Client binaries load from. Configuration Support: Windows Registry and XML file Valid Values: The path where dependent unmanaged Oracle Client binaries reside. Default: |
|
Specifies whether the application enlists in distributed transactions explicitly after an Configuration Support: Windows Registry, XML file, and Valid Values:
Default: 0 |
|
Specifies the total memory size, in bytes, that ODP.NET allocates to cache the data fetched from a database round-trip. This value can be set on the Configuration Support: Windows Registry, XML file, and ODP.NET class Valid Values:
Default: |
|
Specifies the maximum number of statements that can be cached when self-tuning is enabled. Configuration Support: Windows Registry and XML file Valid Values: 0 to Default: |
|
Specifies the name of the XML file that customizes the queries to obtain the metadata the ADO.NET 2.0 Configuration Support: XML file only Valid Values: A complete file name for the XML file. Default: none |
|
Enables or disables publishing performance counters for connection pooling. Multiple performance counters can be obtained by adding the valid values. Configuration Support: Windows Registry and XML file Valid Values:
Default: |
|
Specifies the type of transaction to use when the first connection participates in the Configuration Support: Windows Registry, XML file, and promotable transaction connection string attribute Valid Values:
Default: |
|
Specifies whether self-tuning is enabled for an ODP.NET application. Configuration Support: Windows Registry, XML file, and Valid Values: 0: Self Tuning is disabled. Used in the registry or XML file.
1: Self Tuning is enabled. Used in the registry or XML file.
Default: 1 |
|
Specifies the number of cursors or statements to be cached on the database for each connection. This setting corresponds to Statement Cache Size attribute in the connection string. A value greater than zero also enables statement caching. Configuration Support: Windows Registry, XML file, and Statement Cache Size connection string attribute Valid Values:
Default: |
|
Specifies whether or not Oracle UDTs retrieved by executing a Configuration Support: Windows Registry and XML file Valid Values:
Default: |
|
Specifies the default maximum size of worker threads for each available processor in a process. This value may affect the performance of ODP.NET connection creation, command execution timeout, and external procedures ( Configuration Support: Windows Registry and XML file Valid Values:
Default: Note that prior to ODAC 2007 or version 11.1.0.6.20, ODP.NET resets the thread pool maximum size to |
|
Specifies the file name to be used for logging trace information. Configuration Support: Windows Registry and XML file Valid Values: Any valid directory location and file name. Default: |
|
Specifies the level of tracing in ODP.NET. Because tracing all the entry and exit calls for all the objects can be excessive, Configuration Support: Windows Registry and XML file Valid Values:
Default: 0 Note: ODP.NET does bit-wise checking on the value. When tracing is enabled, logging to the trace file can affect ODP.NET performance. Note: The user-mode dump creation requires |
|
Specifies whether to log trace information in single or multiple files for different threads. If a single trace file is specified, the file name specified in Configuration Support: Windows Registry and XML file Valid Values:
Default: |
|
Specifies the size of the object cache for each connection in kilobytes (KB) that ODP.NET uses to retrieve and manipulate Oracle UDTs. Configuration Support: Windows Registry and XML file Valid Values:
Default: |
|
Specifies a mapping between a custom type and an Oracle UDT in the database. The mappings can be specified in configuration files and custom type factories. However, if the mapping is specified in both places, mappings specified in the configuration files takes precedence over mappings specified using custom type factories. Configuration Support: XML file and Custom Type Factory Classes Valid Values: Any valid mapping. Default: none |
Upon installation, ODP.NET creates entries for configuration and tracing within the Windows Registry. Configuration and tracing registry values apply across all ODP.NET applications running in that Oracle client installation. Individual ODP.NET applications can override some of these values by configuring them within the ODP.NET application itself (for example, FetchSize
). Applications can also use the .NET configuration files to override some of the ODP.NET Windows Registry values.
The ODP.NET registry values are located under HKEY_LOCAL_MACHINE\Software\Oracle\ODP.NET\
version
\
. There is one key for .NET Framework 2.0, 3.0, and 3.5, and one key for .NET Framework 4 and higher.
Note:
32-bit applications running on an x64-based version of Windows use the registry subkey,HKEY_LOCAL_MACHINE\Software\WOW6432node
in place of HKEY_LOCAL_MACHINE\Software
. If such applications use Oracle Data Provider for .NET (32-bit), then the ODP.NET registry values are located under HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Oracle\ODP.NET\version\
.For customers who have numerous applications on a computer that depends on a single version of ODP.NET, the Windows Registry settings for a given version of ODP.NET may not necessarily be applicable for all applications that use that version of ODP.NET. To provide more granular control, ODP.NET Configuration File Support allows developers to specify ODP.NET configuration settings in an application config, web.config
, or a machine.config
file.
If a computer does not require granular control beyond configuration settings at the ODP.NET version level, there is no need to specify ODP.NET configuration settings through configuration files.
The following is an example of a web.config
file for .NET Framework 2.0 and higher:
<?xml version="1.0" encoding="utf-8" ?> <configuration> <oracle.dataaccess.client> <settings> <add name="DllPath" value="C:\oracle\bin"/> <add name="FetchSize" value="131072"/> <add name="PromotableTransaction" value="promotable"/> <add name="StatementCacheSize" value="10"/> <add name="TraceFileName" value="C:\odpnet2.trc"/> <add name="TraceLevel" value="63"/> <add name="TraceOption" value="1"/> </settings> </oracle.dataaccess.client> </configuration>
The following is an example of app.config
for ODP.NET using .NET Framework 2.0, which sets some additional attributes as well as two UDT type mappings:
<?xml version="1.0" encoding="utf-8" ?> <configuration> <oracle.dataaccess.client> <settings> <add name="DbNotificationPort" value="-1"/> <add name="DllPath" value="C:\app\user\product\11.1.0\client_1\bin"/> <add name="DynamicEnlistment" value="0"/> <add name="FetchSize" value="131072"/> <add name="MetaDataXml" value="CustomMetaData.xml"/> <add name="PerformanceCounters" value="4095"/> <add name="PromotableTransaction" value="promotable"/> <add name="StatementCacheSize" value="50"/> <add name="ThreadPoolMaxSize" value="30"/> <add name="TraceFileName" value="c:\odpnet2.trc"/> <add name="TraceLevel" value="0"/> <add name="TraceOption" value="0"/> <add name="Person" value="udtMapping factoryName='PersonFactory, Sample, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' typeName='PERSON' schemaName='SCOTT' dataSource='oracle'"/> <add name="Student" value="udtMapping factoryName='StudentFactory, Sample, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' typeName='STUDENT' schemaName='SCOTT'"/> </settings> </oracle.dataaccess.client> </configuration>