Delta Conflict Detection and Resolution
With delta conflict detection, a conflict occurs when a value in the old column list of the row LCR differs from the value for the corresponding row in the table.
To configure delta conflict detection and resolution for a table, run the ADD_AUTO_CDR_DELTA_RES
procedure in the DBMS_GOLDENGATE_ADM
package. The delta resolution method does not depend on a timestamp or an extra resolution column. With delta conflict resolution, the conflict is resolved by adding the difference between the new and old values in the row LCR to the value in the table. This resolution method is generally used for financial data such as an account balance. For example, if a bank balance is updated at two sites concurrently, then the converged value accounts for all debits and credits.
This example shows a row being replicated at database A and database B. The Balance
column is designated as the column on which delta conflict resolution is performed, and the TS1
column is the invisible timestamp column to track the time of each change to the Balance
column. A change is made to the Balance
value in the row in both databases at nearly the same time (@T20
in database A and @T22
in database B). These changes result in a conflict, and delta conflict resolution is used to resolve the conflict in the following way:
-
At database A, the value of
Balance
was changed from100
to110
. Therefore, the value was increased by 10. -
At database B, the value of
Balance
was changed from100
to120
. Therefore, the value was increased by 20. -
To resolve the conflict at database A, the value of the difference between the new and old values in the row LCR to the value in the table. The difference between the new and old values in the LCR is 20 (120–100=20). Therefore, the current value in the table (110) is increased by 20 so that the value after conflict resolution is 130.
-
To resolve the conflict at database B, the value of the difference between the new and old values in the row LCR to the value in the table. The difference between the new and old values in the LCR is 10 (110–100=10). Therefore, the current value in the table (120) is increased by 10 so that the value after conflict resolution is 130.
After delta conflict resolution, the value of the Balance
column is the same for the row at database A and database B.