Send feedback on this topic.
Teradata.Client.Provider
Configuration File Provider Section
.NET Data Provider for Teradata > Developer's Guide > Working with the Data Provider Features > Configuration Files > Configuration File Provider Section
.NET CORE   This feature is not supported by the .NET Core implementation of the Data Provider.

The <provider> Section Name

The Data Provider supports the following TdConnectionStringBuilder.Properties from an application configuration file. This enables applications to set these properties without recompiling an application. The machine.config file must contain the <teradata.client> Section Group and the <provider> Section name as described in Configuration Files.

  1. ConnectionTimeout
  2. ConnectMaxRetryCount
  3. CommandTimeout
  4. RecoveryTimeout
  5. RecoveryCommandTimeoutOverride
  6. RecoveryStartInterval
  7. RecoveryIntervalFactor
  8. RecoveryMaximumInterval

Accessing TdConnectionStringBuilder Properties in the <provider> Section

The Data Provider will read the application configuration file after the application defines the TdConnection.ConnectionString properties. Any TdConnectionStringBuilder properties not defined in TdConnection.ConnectionString will be supplemented by the profiles found in the configuration file.

The order in which the TdConnectionStringBuilder properties is set is determined from this table.

         Profile Priority Description
         TdConnection.ConnectionString   The values found here have the highest priority when defined in multiple places. A ConnectionTimeout property defined in the TdConnection.ConnectionString will override the same property found in any ProfileName.
         Default Profile When TdConnectionStringBuilder.ProfileName is not defined, a default profile name ("default") if defined in the configuration file will be used to define ConnectionStringBuilder properties not found in the TdConnection.ConnectionString.
         ProfileName When a TdConnectionStringBuilder.ProfileName is defined and the profile name is found in the configuration file, the TdConnectionStringBuilder properties not defined in the TdConnection.ConnectionString properties will be used.
         ProfileName
         and Default ProfileName  
The default ProfileName ("default") may be used to supplement the TdConnectionStringBuilder.ProfileName properties. Properties not found in the ProfileName and not found in the TdConnection.ConnectionString will be supplied from the default ProfileName if it exists.

Example of Profile Definitions in the <provider> Section

The following is an example of several profile names and a "default" profile name as it appears in an application configuration file. The TdConnectionStringBuilder.ProfileName defines which profile name to read and set the TdConnectionStringBuilder properties. If the ProfileName is not found within the application configuration file <profiles> section, an error indicating an invalid connection string attribute will be returned.

Application Configuration File Provider Section Group Example
Copy Code
<?xml version="1.0"?>
<configuration>
   <teradata.client>
      <provider>
         <profiles>
            <add name="TacticalQuery" ConnectionTimeout="10" CommandTimeout="40" />
            <add name="default" ConnectionTimeout="25" CommandTimeout="60" />
            <add name="extended" ConnectionTimeout="40" CommandTimeout="100"
             RecoveryCommandTimeoutOverride="true" RecoveryStartInterval="1" ConnectMaxRetryCount="150"
             RecoveryIntervalFactor="1" RecoveryMaximumInterval="25" />
         </profiles>
      </provider>
   </teradata.client>
   <!--
      Other sections and section groups.
   -->
</configuration>

Definitions of Elements and Their Attributes

The definition for each of the elements and their attributes are as follows:

Elements and Attributes Description
<teradata.client> Element that indicates that the content is for the .NET Data Provider for Teradata.
<provider> Indicates that the information is related to the Data Provider.
<profiles> Indicates a list of profiles follows.
<add> Adds a profile containing values which are read during startup of an application. The values will override the default values supplied by the Data Provider.
      name The name of the profile containing the supported TdConnection.ConnectionString properties.
      ConnectionTimeout This represents the time to wait for establishment of a connection before terminating the attempt.
      ConnectMaxRetryCount The connection maximum retry count. This represents the maximum number of retries of opening a connection until an error is returned to the application.
      CommandTimeout This sets the default command timeout. The Data Provider sets this value internally to 30 seconds.
      RecoveryTimeout The reconnection timeout before terminating reconnection. The RecoveryTimeout is used when the command timeout is 0, or the RecoveryCommandTimeoutOverride is true when using synchronous commands. Asynchronous commands will always use the RecoveryTimeout during reconnection.
      RecoveryCommandTimeoutOverride All synchronous commands that contain a zero (infinite) CommandTimeout will always extend the reconnection time by the RecoveryTimeout. If the command timeout is non-zero, this new override property (when true) will also extend the reconnection time by adding the RecoveryTimeout value.
      RecoveryStartInterval The recovery starting interval time (in seconds). This represents the time between retrying a reconnection attempt.
      RecoveryIntervalFactor The recovery interval factor. This represents the adjustment in the recovery interval period from the preceeding interval period. The factor is a additive factor.
      RecoveryMaximumInterval The recovery maximum interval. This represents the maximum interval time, used to limit the retry interval time adjusted by the RecoveryIntervalFactor.

Element Default Values

      Element Name Default Value
      name none
      ConnectionTimeout 20 (seconds)
      ConnectMaxRetryCount   200
      CommandTimeout 30 (seconds)
      RecoveryTimeout 1200 (seconds)
      RecoveryCommandTimeoutOverride True (Boolean)
      RecoveryStartInterval 2 (seconds)
      RecoveryIntervalFactor 2 (seconds)
      RecoveryMaximumInterval 32 (seconds)

Explanations and Applicability of the Recovery Properties

These properties enable an application to change internally within the Data Provider the behavior during reconnection attempts (when enabled in TdConnectionStringBuilder.Recovery). They are values that are used in algorithms to define the Data Provider retryable behavior.