Hi Geert,
Now I changed the code like this
return <a href="{$const:BATCH-LIST-URL}" onClick="return
deleteScheduledBulkBatch('{$batchDocUri}','{$batchDirUri}')">Click here to
delete</a>
JS
function deleteScheduledBulkBatch(batchDirUri,batchDocUri) {
try
{
}
catch(err)
{
alert(err.message);
}
return true;
}
But I don't know how to call the marklogic functions like
xdmp:document-delete , xdmp:directory-delete,doc-available inside the java
script. Could you please kindly help me.
Thanks & Regards,
Siva
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of
[email protected]
Sent: Wednesday, June 15, 2016 8:54 AM
To: [email protected]
Subject: General Digest, Vol 144, Issue 12
Send General mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
http://developer.marklogic.com/mailman/listinfo/general
or, via email, send a message with subject or body 'help' to
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific than "Re:
Contents of General digest..."
Today's Topics:
1. Re: Regarding XDMP-PREVENTDEADLOCKS (Geert Josten)
----------------------------------------------------------------------
Message: 1
Date: Wed, 15 Jun 2016 07:53:52 +0000
From: Geert Josten <[email protected]>
Subject: Re: [MarkLogic Dev General] Regarding XDMP-PREVENTDEADLOCKS
To: MarkLogic Developer Discussion <[email protected]>
Message-ID: <d386d52c.dc911%[email protected]>
Content-Type: text/plain; charset="us-ascii"
Hi Siva,
Is this an xqy module inside MarkLogic? It will probably run the
xdmp:spawn-function when producing the HTML, rather than on-click. I think you
better use a href that links to the page itself with a request-param indicating
some action is required, and handling that elsewhere in that code, or make the
link point to a different module that will execute the task..
Re preventdeadlocks: you can disable the safeguard with the <prevent-deadlocks>
option, see also http://docs.marklogic.com/xdmp:eval..
Cheers,
Geert
From:
<[email protected]<mailto:[email protected]>>
on behalf of "Mani, Sivasubramani (ELS)"
<[email protected]<mailto:[email protected]>>
Reply-To: MarkLogic Developer Discussion
<[email protected]<mailto:[email protected]>>
Date: Wednesday, June 15, 2016 at 9:24 AM
To: "[email protected]<mailto:[email protected]>"
<[email protected]<mailto:[email protected]>>
Subject: [MarkLogic Dev General] Regarding XDMP-PREVENTDEADLOCKS
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://developer.marklogic.com/pipermail/general/attachments/20160615/0133a930/attachment.html
------------------------------
_______________________________________________
General mailing list
[email protected]
Manage your subscription at:
http://developer.marklogic.com/mailman/listinfo/general
End of General Digest, Vol 144, Issue 12
****************************************
_______________________________________________
General mailing list
[email protected]
Manage your subscription at:
http://developer.marklogic.com/mailman/listinfo/general