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 setting the following TdConnectionStringBuilder.Properties using an application configuration file. This allows users to set these properties without recompiling applications. 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. HttpsPortNumber
  5. RecoveryTimeout
  6. RecoveryCommandTimeoutOverride
  7. RecoveryStartInterval
  8. RecoveryIntervalFactor
  9. RecoveryMaximumInterval
  10. SslMode
  11. ResponseBufferSize
  12. UseXViews

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. For example, 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 Attributes

The definitions for each of the configuration elements are as follows:

Element Name 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.

The <add> element supports the following attributes:

Attribute Name Default Value Description
name none The name of the profile containing the supported TdConnection.ConnectionString properties.
ConnectionTimeout 20 (seconds) This represents the time to wait for establishment of a connection before terminating the attempt.
ConnectMaxRetryCount 200 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 30 (seconds) This sets the default command timeout. The Data Provider sets this value internally to 30 seconds.
HttpsPortNumber 443 Specifies the HTTPS port number to use when establishing a TLS-encrypted connection to the Teradata Gateway.
RecoveryTimeout 1200 (seconds) 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 True (Boolean) 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 2 (seconds) The recovery starting interval time (in seconds). This represents the time between retrying a reconnection attempt.
RecoveryIntervalFactor 2 (seconds) 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 32 (seconds) The recovery maximum interval. This represents the maximum interval time, used to limit the retry interval time adjusted by the RecoveryIntervalFactor.
SslMode "Prefer" (String) Specifies the SslMode.
ResponseBufferSize 524288 (bytes) Specifies the ResponseBufferSize.
UseXViews True (Boolean) Specifies the UseXViews value.

Explanations and Applicability of the Recovery Properties

The following 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.