Created
April 25, 2018 13:47
-
-
Save ableasdale/83e8c5c68e8816fd60fdd2bcb4aaa321 to your computer and use it in GitHub Desktop.
MarkLogic: Get list of transaction locks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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