INFORMIXCONRETRY session environment option
Use the INFORMIXCONRETRY session environment option of the SET ENVIRONMENT statement to specify the maximum number of additional connection attempts that can be made to each database server during a single CONNECT statement in the current session, after the initial connection attempt fails. All these attempts must be made within the time limit that the INFORMIXCONTIME setting specifies.
The INFORMIXCONRETRY session environment option has this syntax:
Element | Description | Restrictions | Syntax |
---|---|---|---|
integer | The maximum number of retry attempts during a CONNECT statement | Must be greater than zero. If you specify no value, the default behavior is a single retry. | Literal Number as Quoted String |
Usage
- integer >
0
- If the first attempt by the CONNECT statement to establish a connection to a database server fails, this value sets an upper limit on the number of additional attempts.
If no connection with another database has been established after (integer + 1) attempts, or after the time limit that INFORMIXCONTIME specifies has been exceeded, the CONNECT statement returns an error.
For the current session only, the setting of the INFORMIXCONRETRY session environment option overrides any other value that is currently set for the INFORMIXCONRETRY client environment variable or for the INFORMIXCONRETRY configuration parameter.
Order of precedence for INFORMIXCONRETRY settings
- The SET ENVIRONMENT INFORMIXCONRETRY statement (for a session)
- The INFORMIXCONRETRY client environment variable setting.
- If INFORMIXCONRETRY configuration parameter in the onconfig file.
- The system default value of 1 additional attempt to establish a new connection to a server.
Unless the setting of the INFORMIXCONRETRY session environment option, or of the INFORMIXCONRETRY configuration parameter, or of the INFORMIXCONRETRY environment variable is an integer greater than zero, the default behavior of the CONNECT statement after a failed initial connection attempt is to attempt a single connection retry.
Examples of setting INFORMIXCONRETRY
1
, restricting
the database server to no more than a single additional connection
attempt if the first attempt fails: SET ENVIRONMENT INFORMIXCONRETRY;
SET ENVIRONMENT INFORMIXCONRETRY '3';
You
can also use double ( "
) quotation marks to delimit
the setting, which allows five retries (or up to a total of 6 connection
attempts) in the following example:
SET ENVIRONMENT INFORMIXCONRETRY "5";
If the INFORMIXCONTIME session environment option or the INFORMIXCONTIME configuration parameter is set to a time interval, that value takes precedence over the INFORMIXCONRETRY setting. That is, the connection attempts can end after the limit in seconds from the INFORMIXCONTIME setting has elapsed, even if this limit is exceeded before the INFORMIXCONRETRY limit on attempts is reached.