
dls:document-checkout( $uri as xs:string, $deep as xs:boolean, [$annotation as item()?], [$timeout as xs:unsignedLong?] ) as empty-sequence()
This function checks out (locks) the document at the specified URI to prevent other users from modifying the document. An exception is thrown if the document does not yet exist or does exist but is not managed.
This function must be called in a separate transaction from thedls:document-update 
  
  and 
  dls:document-checkin 
  
  functions.
dls-user role is required to run 
    this function, or the privilege:http://marklogic.com/xdmp/privileges/dls-user
    
  xquery version "1.0-ml";
  import module namespace dls = "http://marklogic.com/xdmp/dls" 
      at "/MarkLogic/dls.xqy";
  dls:document-checkout("/foo/bar/baz.xml", fn:true(), "updating doc", 3600)
  (: Checks out the 'baz'xml' document, and all of its included documents,
     for one hour. :)
    
  
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.