Product: | Syniti Data Replication (Syniti DR, fka DBMoto) |
Version: | All |
ID: | 1640 |
Summary: | Handling connection timeout and command timeout errors with IBM Db2 for i as a source database |
If a connection timeout occurs when attempting a connection to the database server to process transactions, Syniti DR/DBMoto reports a connection error in the log, then retries the connection at the next mirroring interval.
Command timeout errors can cause replications to fail. They occur when, after initially connecting to the database server, the DBMS is unable to respond to a request from Syniti DR/DBMoto (via the .NET provider) within a time specified in the .NET provider connection string or the Syniti DR/DBMoto connection properties. Error messages such as the one below are reported in the Syniti DR/DBMoto 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 Ritmo/i .NET Provider low-level socket timeout setting ("Init Timeout" connection property) is reached before the Db2 system responds to the Syniti DR/DBMoto request. You can modify this setting from within Syniti DR/DBMoto as described below.
To change the command timeout value, follow the steps in Knowledge Base article 1639: "Handling connection timeout and command timeout errors in Syniti DR/DBMoto".
To change the Init Timeout setting for the Ritmo/i provider:
- If your replication is already running, disable the replication by selecting it in the Metadata Explorer (Management Center) and choosing Enable Replication from the right mouse button menu. The Enable Replication menu item should no longer display a check mark.
- Select the connection to IBM Db2 for i in the Metadata Explorer.
- From the right mouse button menu, choose Connection Properties to open the Connection Properties dialog.
- Scroll to the Init Timeout field in the Optional section.
By default, the value is set to 90 seconds. - Set the value of the Init Timeout field to an appropriate number of seconds. The exact value depends upon your environment, and you may have to try several different settings.
- Click OK in the Connection Properties dialog.
- Enable the replication by selecting it in the Metadata Explorer and choosing Enable Replication from the right mouse button menu. The Enable Replication menu item should display a check mark.
Additionally, 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, and if your read interval is very tight, your i system may not be able to complete a job before the next one is started, therefore building up the number of jobs running on the system. Depending on the server processing capabilities, you may find that this situation causes command timeouts when accessing the transaction log because the server is too busy to respond. The options are to increase the time between reads or increase the command timeout.
To change the read interval:
- If your replication is already running, disable the replication by selecting it in the Metadata Explorer and choosing Enable Replication from the right mouse button menu. 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. - Select the replication in the Metadata Explorer.
- From the right mouse button menu, choose Replication Properties to open the Replication Properties dialog.
- Scroll to the Mirroring options in the Preferences section.
By default, the value is set to 60 seconds (in the Options dialog available from Tools > Options.) - Set the value of the Read Interval field to an appropriate number of seconds. The exact value depends upon your environment, and you may have to try several different settings.
- Click OK in the Replication Properties dialog.
- Enable the replication by selecting it in the Metadata Explorer and choosing Enable Replication from the right mouse button menu. The Enable Replication menu item should display a check mark.