Debian Codegraph @

docs/programmer_reference/lock_config.html

raw symbols SCIP
1 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml">
4 <head>
5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6 <title>Configuring locking</title>
7 <link rel="stylesheet" href="gettingStarted.css" type="text/css" />
8 <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" />
9 <link rel="start" href="index.html" title="Berkeley DB Programmer's Reference Guide" />
10 <link rel="up" href="lock.html" title="Chapter 16.  The Locking Subsystem" />
11 <link rel="prev" href="lock.html" title="Chapter 16.  The Locking Subsystem" />
12 <link rel="next" href="lock_max.html" title="Configuring locking: sizing the system" />
13 </head>
14 <body>
15 <div xmlns="" class="navheader">
16 <div class="libver">
17 <p>Library Version 11.2.5.3</p>
18 </div>
19 <table width="100%" summary="Navigation header">
20 <tr>
21 <th colspan="3" align="center">Configuring locking</th>
22 </tr>
23 <tr>
24 <td width="20%" align="left"><a accesskey="p" href="lock.html">Prev</a> </td>
25 <th width="60%" align="center">Chapter 16. 
26 The Locking Subsystem
27 </th>
28 <td width="20%" align="right"> <a accesskey="n" href="lock_max.html">Next</a></td>
29 </tr>
30 </table>
31 <hr />
32 </div>
33 <div class="sect1" lang="en" xml:lang="en">
34 <div class="titlepage">
35 <div>
36 <div>
37 <h2 class="title" style="clear: both"><a id="lock_config"></a>Configuring locking</h2>
38 </div>
39 </div>
40 </div>
41 <p>The <a href="../api_reference/C/envset_lk_detect.html" class="olink">DB_ENV-&gt;set_lk_detect()</a> method specifies that the deadlock detector
42 should be run whenever a lock is about to block. This option provides
43 for rapid detection of deadlocks at the expense of potentially frequent
44 invocations of the deadlock detector. On a fast processor with a highly
45 contentious application where response time is critical, this is a good
46 choice. An option argument to the <a href="../api_reference/C/envset_lk_detect.html" class="olink">DB_ENV-&gt;set_lk_detect()</a> method
47 indicates which lock requests should be rejected.</p>
48 <p>The application can limit how long it blocks on a contested resource.
49 The <a href="../api_reference/C/envset_timeout.html" class="olink">DB_ENV-&gt;set_timeout()</a> method specifies the length of the timeout.
50 This value is checked whenever deadlock detection is performed,
51 so the accuracy of the timeout depends upon the frequency of
52 deadlock detection.</p>
53 <p>In general, when applications are not specifying lock and transaction
54 timeout values, the <a href="../api_reference/C/lockdetect.html#detect_DB_LOCK_DEFAULT" class="olink">DB_LOCK_DEFAULT</a> option is probably the
55 correct first choice, and other options should only be selected based
56 on evidence that they improve transaction throughput. If an application
57 has long-running transactions, <a href="../api_reference/C/lockdetect.html#detect_DB_LOCK_YOUNGEST" class="olink">DB_LOCK_YOUNGEST</a> will guarantee
58 that transactions eventually complete, but it may do so at the expense
59 of a large number of lock request rejections (and therefore, transaction
60 aborts).</p>
61 <p>The alternative to using the <a href="../api_reference/C/envset_lk_detect.html" class="olink">DB_ENV-&gt;set_lk_detect()</a> method is to
62 explicitly perform deadlock detection using the Berkeley DB
63 <a href="../api_reference/C/lockdetect.html" class="olink">DB_ENV-&gt;lock_detect()</a> method.</p>
64 <p>The <a href="../api_reference/C/envset_lk_conflicts.html" class="olink">DB_ENV-&gt;set_lk_conflicts()</a> method allows you to specify your own
65 locking conflicts matrix. This is an advanced configuration option,
66 and is almost never necessary.</p>
67 </div>
68 <div class="navfooter">
69 <hr />
70 <table width="100%" summary="Navigation footer">
71 <tr>
72 <td width="40%" align="left"><a accesskey="p" href="lock.html">Prev</a> </td>
73 <td width="20%" align="center">
74 <a accesskey="u" href="lock.html">Up</a>
75 </td>
76 <td width="40%" align="right"> <a accesskey="n" href="lock_max.html">Next</a></td>
77 </tr>
78 <tr>
79 <td width="40%" align="left" valign="top">Chapter 16. 
80 The Locking Subsystem
81  </td>
82 <td width="20%" align="center">
83 <a accesskey="h" href="index.html">Home</a>
84 </td>
85 <td width="40%" align="right" valign="top"> Configuring locking: sizing the system</td>
86 </tr>
87 </table>
88 </div>
89 </body>
90 </html>