Search docs.molo17.com

    IBM iSeries logo Db2 for IBM i agent

    How-to guide

    For a step-by-step walkthrough tested on a running Gluesync, see the how-to guide Choose a key strategy: physical, logical, RRN or computed.

    Target Db2 for IBM i

    Prerequisites

    To have Gluesync working on your Db2 for IBM i instance you will need to have:

    • Valid user credentials with permission to read, and write to the target tables and respective database

    Setup via Web UI

    • Hostname / IP Address: DNS record or IP Address of your server;

    • Database name: Name of your target database;

    • Username: Username with read & write access to the target tables;

    • Password: Password belonging to the given username;

    • Max connections count: Maximum number of connections the pool can instantiate.

    Custom host credentials

    • Date Format: Format for date values (default: iso). Allowed values: julian, mdy, dmy, ymd, usa, iso, eur, jis;

    • Time Format: Format for time values (default: iso). Allowed values: hms, usa, iso, eur, jis;

    • Block Size (kilobytes): Size of data blocks in kilobytes (default: 32). Allowed values: 0, 8, 16, 32, 64, 128, 256, 512;

    • Use connection pool: Whether to use connection pooling (default: true);

    Specific configuration

    The following example shows how to apply the agent-specific configurations via Rest API.

    • Date format: (optional, defaults to NULL), the date format to be used when negotiating the JDBC driver connection. It can be any of the following:

      • julian,

      • mdy,

      • dmy,

      • ymd,

      • usa,

      • iso,

      • eur,

      • jis;

    • Time format: (optional, defaults to NULL), the time format to be used when negotiating the JDBC driver connection. It can be any of the following:

      • hms,

      • usa,

      • iso,

      • eur,

      • jis;

    Updates with bulk operations during CDC

    When Use bulk operations during CDC (useBulkOperationsDuringCDC) is on for an entity, the agent does not apply an update as an UPDATE statement. It loads the change into a staging table, deletes the existing row from the target table and inserts the new version of it. With the option off, updates are applied as UPDATE statements.

    For the target table this has the following effects:

    • UPDATE triggers on the target table do not fire, while DELETE and INSERT triggers do;

    • Foreign keys that reference the table with the CASCADE delete rule delete their child rows on every update, while SET NULL and SET DEFAULT change the child columns. A foreign key with RESTRICT or NO ACTION makes the write fail while child rows exist;

    • If the target table is journaled, the journal holds a delete entry and an insert entry instead of an update entry, so anything that reads the journal sees a delete and an insert;

    • The new row can get a new relative record number, and columns that Gluesync does not write, such as a column with a default value, are set again as for a new row.

    Setup via Rest APIs

    Here following an example of calling the Core Hub’s Rest API via curl to setup the connection for this Agent.

    Connect the agent

    curl --location --request PUT 'http://core-hub-ip-address/pipelines/{pipelineId}/agents/{agentId}/config/credentials' \
    --header 'Content-Type: application/json' \
    --header 'Authorization: ••••••' \
    --data '{
            "hostCredentials": {
            "connectionName": "myAgentNickName",
            "host": "host-address",
            "databaseName": "db_name",
            "maxConnectionsCount": 100,
            "username": "",
            "password": ""
    }'

    Setup specific configuration

    The following example shows how to apply the agent-specific configurations via Rest API.

    curl --location --request PUT 'http://core-hub-ip-address/pipelines/{pipelineId}/agents/{agentId}/config/specific' \
    --header 'Content-Type: application/json' \
    --header 'Authorization: ••••••' \
    --data '{
          "configuration": {
                "dateFormat": "iso",
                "timeFormat": "iso"
          }
    }'