By using the Auto Reconnect (-autoReconnect) client-session startup parameter, remote clients can automatically connect to the primary target of an OpenEdge replication database, if the connection to the source database fails. When an OpenEdge database fails over (planned or unplanned) to a replication primary target database, then remote clients (ABL clients or Progress Application Server for OpenEdge agents) running the application, automatically connect to the replication primary target database.

The AVM handles this automatically, without any administrator intervention. At client session startup, during the connection to the replication source database, the AVM retrieves virtual system table (VST) information about the current replication primary target database, so it knows what to connect to if the replication source database fails. If the information changes, clients are automatically notified of the updated information. In this manner, the client always knows what the current replication target database is.

To use this feature, the OpenEdge database must be configured for, and actively using, OpenEdge replication. For more information on OpenEdge replication, see Use Database Replication.

Interaction with -dbalt1 and -dbalt2 client connection parameters

This feature can be used with, or without, the Alternate Database 1 (-dbalt1) and Alternate Database 2 (-dbalt2) client connection parameters. However, it is a good practice to explicitly configure -dbalt1 to be the OpenEdge replication primary target database and -dbalt2 to be the OpenEdge replication secondary target database, in the unlikely event that the replication source database is unavailable during a client’s initial connection, and -dbalt1 is the new replication source. You can set these connection parameters once in a parameter file (.pf), to be used at session startup, or with the CONNECT statement, and not have to change them.

The replication source database and replication primary target database are included in the connection set. The order of database reconnection attempts, after a disconnect, is as follows:
  1. Replication source database
  2. Database specified by -dbalt1, if provided
  3. Database specified by -dbalt2, if provided
  4. Primary replication target database

Frequency of connection set attempts

You can control the number of times to retry connecting to a set of OpenEdge databases, with the Retry Connect Set (-retryConnect) client connection parameter. The default is 0 retries. You can adjust the pause interval between connection set attempts with the Retry Connect Set Pause (-retryConnectPause) client connection parameter. The default value is 5 seconds. You can further control the number of connection attempts for an individual database connection with the Connection Retry Attempts (-ct) client connection parameter. The default is 50 times.

For more information on -dbalt1, -dbalt2, -retryConnect, -retryConnectPause, and -ct, see Learn about automatic database reconnect.

Logging for connections to OpenEdge replication-enabled databases

Database connection logging can be enabled for clients with the DB.Connects log entry type. At logging level 3 or higher, the client logs additional messages for replication-enabled databases.

When the client initially connects to a database, the AVM determines if the database is enabled for replication:
CONN           Connected to replication-enabled database db0 (source)

or

CONN           Connected to replication-enabled database db1 (target)
When the client receives a database user notification from the replication server, indicating the replication target has changed, a message is logged:
CONN           Refresh replication transition information for database db0
On session restart, the client attempts to reconnect to the database specified at startup. The message could say (replication source) or (replication target).
CONN           Attempting to connect to database db0 (replication source)

If the replication transition is in process, one of two messages is logged, depending on the replication state:

CONN           Replication source database db0 is transitioning, rejecting connection

or

CONN           Database db1 is not a replication source, rejecting connection
A message is logged when attempting to connect to the replication target database, after the connection to the replication source either fails or is rejected:
CONN           Failover: attempting to connect to database db1 (replication target)
A message is logged when the target database has completed the transition and is now the replication source:
CONN           Database db1 has transitioned to a replication source
A message is logged when the connection to the transitioned database is successful:
CONN           Connected to replication-enabled database db1 (source)
CONN           Successful reconnection: -db db0,-H hostname,-S port,-ct 1,-U username,-P