Loading TOC...

xdmp.setTransactionTimeLimit

xdmp.setTransactionTimeLimit(
   $time-limit as Number,
   [$host-id as String],
   [$txn-id as String]
) as null

Summary

Set the transaction time limit for a local or remote transaction. Defaults to the configured request timeout.

Parameters
$time-limit The desired time limit, in seconds.
$host-id An optional host ID. If omitted, the local App Server host is assumed. If a host ID is given, then a transaction ID must also be given.
$txn-id An optional transaction ID. If omitted, the current transaction is assumed. If a transaction ID is given, then a host ID must also be given.

Required Privileges

http://marklogic.com/xdmp/privileges/xdmp-set-transaction-time-limit-my

http://marklogic.com/xdmp/privileges/xdmp-set-transaction-time-limit-any

Usage Notes

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.

See Also

Example

xdmp.setTransactionTimeLimit(10);
=> Empty. The time limit of the current transaction on the
   local host is set to 10 seconds.

Example

xdmp.setTransactionTimeLimit(10, xdmp.host(), some-txn-id);
=> Empty. The time limit of the given transaction on the local
   host is set to 10 seconds.

Comments

    Powered by MarkLogic Server 7.0-4.1 and rundmc | Terms of Use | Privacy Policy