If there may be open transactions in the source database when the initial load completes, take the following steps to ensure that they are replicated to the target.
Before running the initial load application, run the following command on the source database using an appropriate database client and record the value returned:
When creating the continuous replication application:
Use the following setting for the CDC reader:
MariaDB Reader: set Start Position to the GTID you recorded before performing the initial load.
MySQL Reader, set Start Time to the timestamp you recorded before performing the initial load.
Oracle Reader, set Start SCN to the SCN you recorded before performing the initial load.
Use the following setting for Database Reader's Ignorable Exception Code property:
MariaDB or MySQL:
1062, NO_OP_UPDATE(1062 is the error code for duplicate primary key)
1, NO_OP_UPDATE(1 is the error code for unique constraint violation)
23505, NO_OP_UPDATE(23505 is the error code for unique_violation)
SQL Server: 2627, NO_OP_UPDATE (1062 is the error code for primary key constraint violation)
When you know all open transactions have completed and been written to the target, undeploy and stop the application, edit the target, clear the Ignorable Exception Code value, save, and deploy and start the application. Since recovery is enabled, writing will resume where it left off, and there should be no missing or duplicate rows.