Handling Command Timeout with IBM iSeries using Mirroring

Prev Next

Overview

If a connection timeout occurs when Syniti Replicate attempts to connect to the database server to process transactions, it reports a connection error in the log and then retries the connection at the next mirroring interval.

Command timeout errors can cause replications to fail. These errors occur when, after initially connecting to the database server, the DBMS is unable to respond to a request from Syniti Replicate (via the .NET provider) within a time specified in the .NET provider connection string or the Syniti Replicate connection properties. Error messages such as the one below are reported in the Syniti Replicate log

System.Data.Sql400.Sql400Exception: Open Connection Error: WSAETIMEDOUT (10060): Connection timed out. 
A connection attempt failed because the connected party did not properly respond after a period of time, 
or established connection failed because connected host has failed to respond
   at System.Data.Sql400.Sql400Connection.Open()

In this case, the timeout occurred because the .NET provider’s low-level socket timeout setting (the Init Timeout connection property) was reached before the Db2 system responded to the Syniti Replicate request. You can modify this setting within Syniti Replicate as described below.

To change the command timeout value, follow the steps described on Handling Connection Timeout Errors in Syniti Replicate.

Update Init Timeout

To change the Init Timeout setting for the .NET provider:

  1. If your replication is already running, disable the replication by right-clicking it in the Metadata Explorer (Management Center) and selecting Enable Replication. The Enable Replication menu item should no longer display a check mark.

  2. Select the connection to IBM Db2 for i in the Metadata Explorer.

  3. Right-click the connection and select Connection Properties to open the Source Connection Properties dialog box.

  4. In the Optional section, set the value of Init Timeout field to 90 seconds.

    The exact value depends upon your environment, and you may have to try several different settings.

  5. Click OK in the Source Connection Properties dialog box.

  6. Enable the replication by right-clicking it in the Metadata Explorer and selecting Enable Replication. The Enable Replication menu item should display a check mark.

Update Read Interval

Note

When using IBM Db2 for i as a source database, you should be aware that the lower you set the mirroring interval, the more stress you place on your database server.

Each time a connection is opened to read the transaction journal, the i system starts a job. If your read interval is very short, your i system may not be able to complete a job before the next one begins, causing the number of active jobs to accumulate. Depending on the server’s processing capacity, this buildup can lead to command timeouts when accessing the transaction log because the server is too busy to respond.

To address this, you can either increase the time between reads or increase the command timeout.

To change the read interval:

  1. If your replication is already running, disable the replication by right-clicking it in the Metadata Explorer and selecting Enable Replication. The Enable Replication menu item should no longer display a check mark.

    Note

    If the replication in question is in a group, you will need to either set the interval for the group or remove the replication from the group and set the interval for the replication.

  2. In the Metadata Explorer, select the replication and right-click.

  3. Select Replication Properties to open the Replication Properties dialog box.

  4. In the Preferences > Mirroring section, set the value of Read Interval (sec) to 60 seconds.
    By default, the value is set to 60 seconds (in the Options dialog box from Tools > Options). The exact value depends upon your environment, and you may have to try several different settings.

  5. Click OK in the Replication Properties dialog box.

  6. Enable the replication by right-clicking it in the Metadata Explorer and selecting Enable Replication. The Enable Replication menu item should display a check mark.