Client General Connection Attributes
Used only when you are connecting to a TimesTen server from a TimesTen client application.
In addition to the attributes detailed in this section, some database attributes and general connection attributes are also available for client connections or impact the behavior of the connection. These attributes are:
To view the value of a client attribute:
-
In ODBC 3.5, use the ODBC function
SQLGetConnectAttr. To learn more about this function, see Attribute Support for ODBC 3.5 SQLSetConnectAttr and SQLGetConnectAttr in Oracle TimesTen In-Memory Database C Developer's Guide -
In ODBC 2.5, use the ODBC function
SQLGetConnectOption. To learn more about this function, see Option Support for ODBC 2.5 SQLSetConnectOption and SQLGetConnectOption section of the Oracle TimesTen In-Memory Database C Developer's Guide.
The client general connection attributes are described in detail next.
TTC_REDIRECT
Automatic redirection: By default, this connection attribute is set to 1 so that a client connection is automatically redirected to any available data instance within the grid if the current host is busy or unavailable. The connection is redirected to the host with the fewest number of client connections.
Elements within a single replica set: If you want the client to connect to elements within a single replica set (because the data you are interested in is contained within this replica set), then set the TTC_REDIRECT connection attribute to 0. Then, the client connects only to the host indicated by the DSN or to the host with the element in the same replica set. If the connection is rejected, then a connection error is returned.
The TTC_Redirect_Limit attribute limits how many times the client is redirected. The number of hosts in your grid can be of a size that you want to limit the number of redirected client connection attempts for performance reasons. You can set the TTC_Redirect_Limit connection attribute to the number of connection redirection attempts. For example, setting TTC_Redirect_Limit=10 limits the number of client connection redirection attempts to other hosts to 10 attempts. If the client does not connect within this number of attempts, a connection error is returned.
Required Privilege
No privilege is required to change the value of this attribute.
Setting
Set TTC_REDIRECT as follows:
| Where to set the attribute | How the attribute is represented | Setting |
|---|---|---|
|
C or Java programs or UNIX and Linux systems |
|
1 (default) - redirect to any available data instance 0 - error if redirection to specified data instance fails |
|
Windows ODBC Data Source Administrator |
Not applicable |