Note that there are some explanatory texts on larger screens.

plurals
  1. POMarkLogic dls library- conflicting updates
    primarykey
    data
    text
    <p>Well, we have what should be a pretty simple scenario. </p> <p>We utilize Marklogic dls library to manage documents, so below is the code</p> <p>The variable passed in looks like one below:</p> <pre><code> $doc: =&lt;root&gt; &lt;node1&gt; &lt;subnode/&gt;&lt;/node1&gt; &lt;node2&gt; &lt;status/&gt; &lt;/node2&gt; &lt;root&gt; </code></pre> <p>The function replaces/updates couple of different nodes in the doc. Checks in and then returns a map of id-version pairs.</p> <pre><code>declare function process-and-version($doc) { for $sb in $doc/node1/subnode return if ($sb/node3) then xdmp:node-replace($sb/node3, &lt;node3&gt;foo&lt;/node&gt;) else xdmp:node-insert-after($sb, &lt;node3&gt;foo&lt;/node&gt;), xdmp:node-replace($doc/status, &lt;status&gt;{$status}&lt;/status&gt;), dls:document-checkout-update-checkin("fn:base-uri($doc), $doc, "", fn:true()), let $updated-version:= &lt;entry&gt;{ let $version := c:get-latest-version($uri) (:another function in our lib that uses cts:search:) return ($doc/node1, &lt;version&gt;{$version}&lt;/version&gt;) } &lt;/entry&gt; return $updated-version }; </code></pre> <p>We are using XRAY to test drive this and getting the following error:</p> <pre><code>&lt;error:error xsi:schemaLocation="http://marklogic.com/xdmp/error error.xsd" xmlns:error="http://marklogic.com/xdmp/error" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt; &lt;error:code&gt;XDMP-CONFLICTINGUPDATES&lt;/error:code&gt; &lt;error:name&gt;&lt;/error:name&gt; &lt;error:xquery-version&gt;1.0-ml&lt;/error:xquery-version&gt; &lt;error:message&gt;Conflicting updates&lt;/error:message&gt; </code></pre> <p>Many thanks in advance for help, </p> <p>im</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload