Hi team,
I got the XDMP-PREVENTDEADLOCKS error while I try to call a marklogic function
inside the Html hreaf onClick event. Kindly guide me how to achieve this.
Code:
<dt>Delete</dt>,
<dd>{
let $userId := auth:get-current-user-id()
let $batchId := xs:string(data($batch/@id))
let $batchDocUri :=
batlib:get-batch-xml-uri($userId, $batchId)
let $batchDirUri := concat("/repo/user/", $userId,
$const:PATH-SEP, $batcon:BATCHES, $const:PATH-SEP,
$batchId, $const:PATH-SEP)
return <a href="{$const:BATCH-LIST-URL}" onClick="{
xdmp:spawn-function(function() {
let $deletebBatchDir := try {
xdmp:directory-delete($batchDirUri)
} catch($e){
""
}
return (if(doc-available($batchDocUri)) then
xdmp:document-delete($batchDocUri)
else(),xdmp:commit())
},<options xmlns="xdmp:eval">
<transaction-mode>update</transaction-mode>
</options>)
Error Message:
<error:code>XDMP-PREVENTDEADLOCKS</error:code>
<error:name/>
<error:xquery-version>1.0-ml</error:xquery-version>
<error:message>Processing an update from an update with different-transaction
isolation could deadlock</error:message>
<error:format-string>XDMP-PREVENTDEADLOCKS:
xdmp:invoke("/application/views/batch/available-batches.xqy", (fn:QName("",
"view-data"), map:map(<map:map xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:map="http://marklogic.com/xdmp/map"><map:entry
key="batchType"><map:value
xsi:type="xs:string">norma...</map:map>), fn:QName("", "form-data"),
...), <options
xmlns="xdmp:eval"><isolation>different-transaction</isolation><prevent-deadlocks>t...</options>)
-- Processing an update from an update with different-transaction isolation
could deadlock</error:format-string>
<error:retryable>false</error:retryable>
Thanks & Regards,
Siva
_______________________________________________
General mailing list
[email protected]
Manage your subscription at:
http://developer.marklogic.com/mailman/listinfo/general