Batch journal inserts - Connect_CDC - aws_mainframe_modernization_service - connect_cdc_mimix_share - Latest

AWS Mainframe Modernization - Data Replication for IBM i

Product type
Software
Portfolio
Integrate
Product family
Connect
Product
AWS Mainframe Modernization > AWS Mainframe Modernization Service
Version
Latest
Language
English
Product name
AWS Mainframe Modernization
Title
AWS Mainframe Modernization - Data Replication for IBM i
Copyright
2024
First publish date
2003
Last updated
2024-02-01
Published on
2024-02-01T23:02:31.099696

Batch journal inserts is a check box which appears if you the check box Journal target mapping. If Batch journal inserts is selected, the journal table inserts are executed in a batch instead of one row at time. For each journal target table using the batch option there is a batch statement associated with the table. Each batch uses a prepared statement, which requires only the values to be added to the statement. When the rows are received from the source, they are added to the batch for the table specified in the insert instead of immediately executing the insert. When enough rows have been added to the batch to reach the batch threshold of 500 rows, the batch is executed. When the commit row for the transaction is received from the source, each batch with pending inserts is executed and after all pending inserts are complete, the transaction is committed.

Using prepared batch statements provides a significant performance improvement. However, since the rows for each table are added to the batch, instead of immediately being applied, the actual updates to the target tables can be executed in a different order than when they were executed on the source. The order of updates within the same table is the same on the target as on the source. The order of updates between multiple tables may be different. The following example shows how the apply order can be changed:

Source Server execution order:

  1. Insert 5 rows into TABLEA.

  2. Insert 5 rows into TABLEB.

  3. Insert 500 rows into TABLEC.

Target Server apply order:

  1. Insert 500 rows into TABLEC (because batch threshold was reached.)

  2. Insert 5 rows into TABLEB.

  3. Insert 5 rows into TABLEA.

If there are any dependencies between tables, such as Primary Key/Foreign key referential integrity constraints, changing the apply order will cause a problem. In the above example, if TABLEA has a primary key and TABLEC has a foreign key relationship, an error will occur when inserting into TABLEC because the rows must be inserted into TABLEA first. The batch option should not be selected if there are order dependencies between tables.