# Commit framework

With AS/400 IBMi source databases, this framework is used to manage the following actions:

* commit: to save the changes done in the transaction in tables/databases, and
* rollback: to undo the transactions that have not been saved in the database.

## About this task

## Procedure

1. From the window called Adding tables to the model, select Commit in the list, select tables and click Ok.

   ![](https://help.qlik.com/talend/en-US/change-data-capture-reference-guide/Resources/images/tcdc-adding-commit-framework.png)

   In the table list of columns, the \*COMMIT/COMMIT\_CTL file is added. This table is automatically created and journalized. It will receive the transactions that are being validated.

   ![](https://help.qlik.com/talend/en-US/change-data-capture-reference-guide/Resources/images/tcdc-adding-commit-framework-2.png)

   The replication is performed in two steps.

   At step 1, for each file, the transaction actions on tables are added to the COMMIT\_MSG table. When there is a commit/rollback, the COMMIT/COMMIT\_CTL entry deletes or validates the transactions in COMMIT\_MSG file.

   At step 2, the actions at the level of COMMIT\_MSG table are processed when a commit/rollback action is performed. The final tables are updated. This process is performed for each table.
2. In case the source and target databases are not on the same AS/400 IBMI machine, you need to distribute the model two times:
   * First time: on the source machine, only keeping in the distributed files \*COMMIT/COMMIT\_CTL and the files retrieved at Step 1.
   * Second time: on the target machine, only keeping the files retrieved at Step 2 in the distributed files.

   Information noteNote: In case transformations were performed, it is recommended to include them in Step 2.
3. Follow [Preparing the replication](https://help.qlik.com/talend/r/en-US/7.3/change-data-capture-user-guide/preparing-replication) procedure starting from step 4, then [Operating a replication](https://help.qlik.com/talend/en-US/change-data-capture-user-guide/7.3/operating-a-replication).