Skip to content

Instantly share code, notes, and snippets.

@ableasdale
Created April 25, 2018 13:47
Show Gist options
  • Save ableasdale/83e8c5c68e8816fd60fdd2bcb4aaa321 to your computer and use it in GitHub Desktop.
Save ableasdale/83e8c5c68e8816fd60fdd2bcb4aaa321 to your computer and use it in GitHub Desktop.
MarkLogic: Get list of transaction locks
declare namespace server ="http://marklogic.com/xdmp/status/server";
declare variable $host := xdmp:host();
for $server in xdmp:servers()
return
for $request in xdmp:server-status($host,$server)//server:request-status
let $transaction-id := $request/server:transaction-id
let $start-time := $request/server:start-time/text()
order by $request/server:start-time ascending
return
(
"Server : "||xdmp:server-name($server),
"Transaction : "||$transaction-id,
"Started at : "||$start-time,
try{xdmp:transaction-locks($host, $transaction-id)}catch($e){}
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment