[Chapter 3. Detailed Configuration [section D],

Source: Internet
Author: User

[Chapter 3. Detailed Configuration [section D],
1.6. Conflicts3.7.1. Conflict Detection and Resolution

Conflict Detection and resolution is a new feature of javasricds 3.0. Conflict detection is a policy that determines whether to insert, update, or delete data. The conflict is because the target data is inconsistent with the data previously inserted, updated, or deleted on the source node. Conflict resolution is what is determined when a conflict is detected.
The CONFLICT detection and resolution policies are configured in the CONFLICT table. Configure this conflict policy for at least one NODE_GROUP_LINK. The configuration information is limited to one CHANNEL or table.
CONFLICT Detection is specified by the detect_type and detect_expression columns in the CONFLICT table. The value of detect_expression depends on the value of detect_type. When the data is loaded to the target system, the system performs conflict detection.

USE_PK_DATA
Indicates that only the primary key is used to detect conflicts. If a row with the same primary key already exists, no conflict will be detected during update or deletion. Only primary key columns are used to update and delete a row of data. If a row of data already exists at the time of insertion, a conflict is detected.

USE_OLD_DATA
It indicates that the old values of each column of a row of data are used to detect conflicts. The old data is the value of this row before the change in the source node. If a row of data with the same old data exists in the target system, no conflict is detected during update or deletion. If a row of data already exists during insertion, a data conflict is detected.
Note that some platforms do not know the comparison of binary columns. Conflicts between binary columns are not detected on the following platforms: DB2, DERBY, ORACLE, and SQLSERVER.

USE_CHANGED_DATA
Opposite to the above.

USE_TIMESTAMP
The condition is primary key + timestamp column.

USE_VERSION
The condition is that the primary key + a version number column.

Important
Note: When use_stream_lobs is set to true on the Trigger corresponding to the table, Conflict Detection does not detect binary columns. In addition, some databases do not allow comparison of binary columns, whether use_stream_lobs is set to true or not.
You can configure how to handle CONFLICT detection in the resolve_type column of the CONFLICT table. You can configure two optional Boolean values, resolve_row_only and resolve_changes_only. The following describes how to set this solution.

FALLBACK
Indicates that when a conflict is detected, the system should automatically apply the changed data. If the source node is inserted, data will be updated. If the operation on the source node is updated but the row of data on the target node does not exist, the insert operation will be attempted on the target node. If the operation room of the source node is deleted but the row of data in the target node does not exist, the deletion operation of the target node will be ignored. Resolve_changes_only indicates whether all rows are updated or only columns that have changed are controlled in one fallback operation.

IGNORE
Indicates that when a conflict is detected, the system automatically ignores it. The Resolve_row_only column controls whether the entire batch is ignored or only this row of data is ignored.

MANUAL
It indicates that when a conflict is detected, the entire Batch will remain in the error state until manual intervention. A row of wrong data is inserted into the INCOMING_ERROR table. The identifier of this CONFLICT detection (for example, conflict_id in the CONFLICT table) will be recorded and old data will be recorded, new data and current data (the current data refers to unexpected data on the target node, which does not want to match the old data as expected) to old_data, new_data and cur_data. To solve the conflict, the resolve_data column can be manually filled to replace the original data, which will be used for the next loading attempt. The Resolve_ignore identifier is used to indicate whether the row of data should be ignored during the next loading.

NEWER_WINS
This indicates that when a conflict is detected using USE_TIMESTAMP or USE_VERSION, the target node data will be updated using the updated timestamp or data of a later version.
For each configured conflict detection policy, you can control whether and how many conflicting data are sent back to the node where the data conflict is located. You can set one of the values in the ping_back column to control this policy:

OFF
No data is sent back to the original node. Even the resolved data does not match the data sent by the node.

SINGLE_ROW
A row in a Batch causes a conflict and the resolved data is sent back to the original node.

REMAING_ROWS
A row of data that is resolved after a conflict occurs in a batch and is sent back to the original node together with the remaining data in the entire Batch.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.