In one of the project, when we are using Datahub to load data from SAP to Hybris, we have find a strange issue. We are loading customer data with one flag (say ship-Together) is loading properly first time. But, after that, if the value is changes at the source (SAP), the changed value in Hybris is not showing always. Sometimes corrected value is updated and sometimes not. The reason is very trivial and depends on the Item status and life cycle. The life cycle of the canonical items is as below
1. For new data set, canonical items are created.
2. If the canonical item was composed successfully with no errors, the newly created canonical item gets assigned a status of SUCCESS. Only canonical items with a status of SUCCESS are published to a target system, any other items are ignored during publication. There can only be one canonical item with a status of SUCCESS per integration key in the same pool.
2A. In case the items was not composed properly, the status changed to ERROR
3. Now, if the updated data set is sent, if the integration key is same for the new data set as the previous, the previously data set will be merged with the new data set and the old&new data set status changed to ARCHIVED. In the MERGED data set, the value of the field which has different value in old and new set, is not deterministic.

Solution: Since we have faced the issue with datahub 5.3, where we do not have datahub clean up jar, we have two alternatives.
1. Write a PL/SQL trigger on the column. When the value changed to SUCCESS, change the value as DELETE. In that case, the column will not considered for merging.
2. The solution we have provided is, in the Integration keys, we have included current timestamp. In that case for each dataset, the integration key will be unique and we'll not face the MERGING issue.
Please provide feedback if any. Till then, happy coding.
Informative blog on SAP
ReplyDeleteSAP Training in Chennai