diff options
Diffstat (limited to 'docs/programmer_reference/lock_timeout.html')
| -rw-r--r-- | docs/programmer_reference/lock_timeout.html | 126 |
1 files changed, 73 insertions, 53 deletions
diff --git a/docs/programmer_reference/lock_timeout.html b/docs/programmer_reference/lock_timeout.html index 1b3001e0..97392f17 100644 --- a/docs/programmer_reference/lock_timeout.html +++ b/docs/programmer_reference/lock_timeout.html @@ -14,17 +14,16 @@ <body> <div xmlns="" class="navheader"> <div class="libver"> - <p>Library Version 11.2.5.3</p> + <p>Library Version 12.1.6.1</p> </div> <table width="100%" summary="Navigation header"> <tr> - <th colspan="3" align="center">Deadlock detection using timers</th> + <th colspan="3" align="center">Deadlock detection using + timers</th> </tr> <tr> <td width="20%" align="left"><a accesskey="p" href="lock_dead.html">Prev</a> </td> - <th width="60%" align="center">Chapter 16. - The Locking Subsystem - </th> + <th width="60%" align="center">Chapter 16. The Locking Subsystem </th> <td width="20%" align="right"> <a accesskey="n" href="lock_deaddbg.html">Next</a></td> </tr> </table> @@ -34,57 +33,78 @@ <div class="titlepage"> <div> <div> - <h2 class="title" style="clear: both"><a id="lock_timeout"></a>Deadlock detection using timers</h2> + <h2 class="title" style="clear: both"><a id="lock_timeout"></a>Deadlock detection using + timers</h2> </div> </div> </div> - <p>Lock and transaction timeouts may be used in place of, or in addition -to, regular deadlock detection. If lock timeouts are set, lock requests -will return <a class="link" href="program_errorret.html#program_errorret.DB_LOCK_NOTGRANTED">DB_LOCK_NOTGRANTED</a> from a lock call when it is -detected that the lock's timeout has expired, that is, the lock request -has blocked, waiting, longer than the specified timeout. If transaction -timeouts are set, lock requests will return <a class="link" href="program_errorret.html#program_errorret.DB_LOCK_NOTGRANTED">DB_LOCK_NOTGRANTED</a> -from a lock call when it has been detected that the transaction has been -active longer than the specified timeout.</p> - <p>If lock or transaction timeouts have been set, database operations will -return <a class="link" href="program_errorret.html#program_errorret.DB_LOCK_DEADLOCK">DB_LOCK_DEADLOCK</a> when the lock timeout has expired or the -transaction has been active longer than the specified timeout. -Applications wanting to distinguish between true deadlock and timeout -can use the <a href="../api_reference/C/envset_flags.html" class="olink">DB_ENV->set_flags()</a> configuration flag, which causes -database operations to instead return <a class="link" href="program_errorret.html#program_errorret.DB_LOCK_NOTGRANTED">DB_LOCK_NOTGRANTED</a> in the -case of timeout.</p> - <p>As lock and transaction timeouts are only checked when lock requests -first block or when deadlock detection is performed, the accuracy of -the timeout depends on how often deadlock detection is performed. More -specifically, transactions will continue to run after their timeout has -expired if they do not block on a lock request after that time. -A separate deadlock detection thread (or process) should always -be used if the application depends on timeouts; otherwise, if -there are no new blocked lock requests a pending timeout will -never trigger.</p> - <p>If the database environment deadlock detector has been configured with -the <a href="../api_reference/C/lockdetect.html#detect_DB_LOCK_EXPIRE" class="olink">DB_LOCK_EXPIRE</a> option, timeouts are the only mechanism by -which deadlocks will be broken. If the deadlock detector has been -configured with a different option, then regular deadlock detection will -be performed, and in addition, if timeouts have also been specified, -lock requests and transactions will time out as well.</p> - <p>Lock and transaction timeouts may be specified on a database environment -wide basis using the <a href="../api_reference/C/envset_timeout.html" class="olink">DB_ENV->set_timeout()</a> method. Lock timeouts may be -specified on a per-lock request basis using the <a href="../api_reference/C/lockvec.html" class="olink">DB_ENV->lock_vec()</a> method. Lock -and transaction timeouts may be specified on a per-transaction basis -using the <a href="../api_reference/C/txnset_timeout.html" class="olink">DB_TXN->set_timeout()</a> method. Per-lock and per-transaction -timeouts supersede environment wide timeouts.</p> - <p>For example, consider that the environment wide transaction timeout has -been set to 20ms, the environment wide lock timeout has been set to -10ms, a transaction has been created in this environment and its timeout -value set to 8ms, and a specific lock request has been made on behalf -of this transaction where the lock timeout was set to 4ms. By default, -transactions in this environment will be timed out if they block waiting -for a lock after 20ms. The specific transaction described will be timed -out if it blocks waiting for a lock after 8ms. By default, any lock -request in this system will be timed out if it blocks longer than 10ms, -and the specific lock described will be timed out if it blocks longer -than 4ms.</p> + <p> + Lock and transaction timeouts may be used in place of, or in + addition to, regular deadlock detection. If lock timeouts are + set, lock requests will return <a class="link" href="program_errorret.html#program_errorret.DB_LOCK_NOTGRANTED">DB_LOCK_NOTGRANTED</a> + from a lock call when it is + detected that the lock's timeout has expired, that is, the + lock request has blocked, waiting, longer than the specified + timeout. If transaction timeouts are set, lock requests will + return <a class="link" href="program_errorret.html#program_errorret.DB_LOCK_NOTGRANTED">DB_LOCK_NOTGRANTED</a> + from a lock call when it has been detected that the transaction has been + active longer than the specified timeout. + </p> + <p> + If lock or transaction timeouts have been set, database + operations will return <a class="link" href="program_errorret.html#program_errorret.DB_LOCK_DEADLOCK">DB_LOCK_DEADLOCK</a> + when the lock timeout has expired + or the transaction has been active longer than the specified + timeout. Applications wanting to distinguish between true + deadlock and timeout can use the <a href="../api_reference/C/envset_flags.html" class="olink">DB_ENV->set_flags()</a> configuration + flag, which causes database operations to instead return <a class="link" href="program_errorret.html#program_errorret.DB_LOCK_NOTGRANTED">DB_LOCK_NOTGRANTED</a> + in the case of timeout. + </p> + <p> + As lock and transaction timeouts are only checked when lock + requests first block or when deadlock detection is performed, + the accuracy of the timeout depends on how often deadlock + detection is performed. More specifically, transactions will + continue to run after their timeout has expired if they do not + block on a lock request after that time. A separate deadlock + detection thread (or process) should always be used if the + application depends on timeouts; otherwise, if there are no + new blocked lock requests a pending timeout will never + trigger. + </p> + <p> + If the database environment deadlock detector has been + configured with the <a href="../api_reference/C/lockdetect.html#detect_DB_LOCK_EXPIRE" class="olink">DB_LOCK_EXPIRE</a> option, timeouts are the + only mechanism by which deadlocks will be broken. If the + deadlock detector has been configured with a different option, + then regular deadlock detection will be performed, and in + addition, if timeouts have also been specified, lock requests + and transactions will time out as well. + </p> + <p> + Lock and transaction timeouts may be specified on a database + environment wide basis using the <a href="../api_reference/C/envset_timeout.html" class="olink">DB_ENV->set_timeout()</a> method. Lock + timeouts may be specified on a per-lock request basis using + the <a href="../api_reference/C/lockvec.html" class="olink">DB_ENV->lock_vec()</a> method. Lock and transaction timeouts may be + specified on a per-transaction basis using the + <a href="../api_reference/C/txnset_timeout.html" class="olink">DB_TXN->set_timeout()</a> method. Per-lock and per-transaction timeouts + supersede environment wide timeouts. + </p> + <p> + For example, consider that the environment wide transaction + timeout has been set to 20ms, the environment wide lock + timeout has been set to 10ms, a transaction has been created + in this environment and its timeout value set to 8ms, and a + specific lock request has been made on behalf of this + transaction where the lock timeout was set to 4ms. By default, + transactions in this environment will be timed out if they + block waiting for a lock after 20ms. The specific transaction + described will be timed out if it blocks waiting for a lock + after 8ms. By default, any lock request in this system will be + timed out if it blocks longer than 10ms, and the specific lock + described will be timed out if it blocks longer than + 4ms. + </p> </div> <div class="navfooter"> <hr /> |
