I am using javascript for my harmonization that works fine in MarkLogic DHF 2.1.0. We recently upgraded to MarkLogic Data Hub Framework 4.1.0.
The upgrade is causing problem as most of my documents are now NOT being harmonized. Harmonization runs fine from collector, to content, main and triples but upon checking the traces, I saw that the problem is within the Writer.sjs section.
Below is the snippet of the error in the Writer.sjs:
xdmp.documentInsert(options.uri, envelope, {permissions : xdmp.defaultPermissions(), collections : [options.entity, "FWEWorkOrder"]});
While below is the current code in the writer:
xdmp.documentInsert(options.uri, envelope, [xdmp.permission('rest-reader', 'read'),xdmp.permission('rest-writer', 'update')], [options.entity, "FWEWorkOrder"]);
"message":"Conflicting updates","stack":"XDMP-CONFLICTINGUPDATES: xdmp.documentInsert(\"/FWE/WorkOrder/Thailand/1003160.xml\", XMLDocument(\"http://marklogic.com/entity-services'>......\"), Sequence({capability:\"read\", roleId:\"7089338530631756591\"}, {capability:\"update\", roleId:\"15520654661378671735\"}), Sequence(\"WorkOrder\", \"FWEWorkOrder\")) -- Conflicting updates xdmp.documentInsert(\"/FWE/WorkOrder/Thailand/1003160.xml\
Please do note that very few of my records, which is about 1% of the total records being harmonized, DID NOT encounter any problems.
Below is my code in the writer.sjs before:
Do you have any idea on what is causing the XDMP-CONFLICTINGUPDATES error?