xdmp:set-transaction-time-limit( $time-limit as xs:unsignedInt, [$host-id as xs:unsignedLong], [$txn-id as xs:unsignedLong] ) as empty-sequence()
Set the transaction time limit for a local or remote transaction. Defaults to the configured request timeout.
http://marklogic.com/xdmp/privileges/xdmp-set-transaction-time-limit-my
http://marklogic.com/xdmp/privileges/xdmp-set-transaction-time-limit-any
The transaction time limit determines how long the transaction may run before being automatically aborted. If you set the time limit to a limit less than the elapsed time of the current transaction, the transaction may abort immediately.
The default (and maximum) transaction time limit is the request time
limit configured for the server that creates the transaction. For
information on configuring the request time limit, see the Administrator's
Guide, or
admin:appserver-set-request-timeout
.
If you attempt to set the transaction time limit to a value greater
than the configured request time limit, the exception
XDMP-TIMELIMIT
is raised.
Changing any time limits on a request, even if it happens in an eval or an invoke that is inside the original request, affects the whole request; that is, the timeouts affect the entire App Server request. Therefore, if you set the limit lower on an eval or an invoke within an outer App Server request, that new timeout is used for the entire request.
xdmp:set-transaction-time-limit(10) => Empty. The time limit of the current transaction on the local host is set to 10 seconds.
xdmp:set-transaction-time-limit(10, xdmp:host(), $some-txn-id) => Empty. The time limit of the given transaction on the local host is set to 10 seconds.