Debian Codegraph @

docs/api_reference/CXX/lockdetect.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>DbEnv::lock_detect()</title>
7 <link rel="stylesheet" href="apiReference.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 C++ API Reference" />
10 <link rel="up" href="lock.html" title="Chapter 7.  The DbLock Handle" />
11 <link rel="prev" href="envset_lk_tablesize.html" title="DbEnv::set_lk_tablesize()" />
12 <link rel="next" href="lockget.html" title="DbEnv::lock_get()" />
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">DbEnv::lock_detect()</th>
22 </tr>
23 <tr>
24 <td width="20%" align="left"><a accesskey="p" href="envset_lk_tablesize.html">Prev</a> </td>
25 <th width="60%" align="center">Chapter 7. 
26 The DbLock Handle
27 </th>
28 <td width="20%" align="right"> <a accesskey="n" href="lockget.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="lockdetect"></a>DbEnv::lock_detect()</h2>
38 </div>
39 </div>
40 </div>
41 <pre class="programlisting">#include &lt;db_cxx.h&gt;
42
43 int
44 DbEnv::lock_detect(u_int32_t flags, u_int32_t atype, int *rejected);</pre>
45 <p>
46 The <code class="methodname">DbEnv::lock_detect()</code> method runs one iteration of the deadlock
47 detector. The deadlock detector traverses the lock table and marks one
48 of the participating lock requesters for rejection in each deadlock it
49 finds.
50 </p>
51 <p>
52 The <code class="methodname">DbEnv::lock_detect()</code> <span>
53
54 <span>
55 method either returns a non-zero error value or throws an
56 exception that encapsulates a non-zero error value on
57 failure, and returns 0 on success.
58 </span>
59 </span>
60 </p>
61 <div class="sect2" lang="en" xml:lang="en">
62 <div class="titlepage">
63 <div>
64 <div>
65 <h3 class="title"><a id="idp8032192"></a>Parameters</h3>
66 </div>
67 </div>
68 </div>
69 <div class="sect3" lang="en" xml:lang="en">
70 <div class="titlepage">
71 <div>
72 <div>
73 <h4 class="title"><a id="idp8032040"></a>flags</h4>
74 </div>
75 </div>
76 </div>
77 <p>
78 The <span class="bold"><strong>flags</strong></span> parameter is currently
79 unused, and must be set to 0.
80 </p>
81 </div>
82 <div class="sect3" lang="en" xml:lang="en">
83 <div class="titlepage">
84 <div>
85 <div>
86 <h4 class="title"><a id="idp8024496"></a>atype</h4>
87 </div>
88 </div>
89 </div>
90 <p>
91 The <span class="bold"><strong>atype</strong></span> parameter specifies which
92 lock request(s) to reject. The deadlock detector will reject the lock
93 request with the lowest priority. If multiple lock requests have the
94 lowest priority, then the <span class="bold"><strong>atype</strong></span>
95 parameter is used to select which of those lock requests to reject.
96 It must be set to one of the following list:
97 </p>
98 <div class="itemizedlist">
99 <ul type="disc">
100 <li>
101 <p><a id="detect_DB_LOCK_DEFAULT"></a>
102 <code class="literal">DB_LOCK_DEFAULT</code>
103 </p>
104 <p>
105 Use the default lock policy, which is DB_LOCK_RANDOM.
106 </p>
107 </li>
108 <li>
109 <p><a id="detect_DB_LOCK_EXPIRE"></a>
110 <code class="literal">DB_LOCK_EXPIRE</code>
111 </p>
112 <p>
113 Reject lock requests which have timed out. No other deadlock
114 detection is performed.
115 </p>
116 </li>
117 <li>
118 <p><a id="detect_DB_LOCK_MAXLOCKS"></a>
119 <code class="literal">DB_LOCK_MAXLOCKS</code>
120 </p>
121 <p>
122 Reject the lock request for the locker ID with the most locks.
123 </p>
124 </li>
125 <li>
126 <p><a id="detect_DB_LOCK_MAXWRITE"></a>
127 <code class="literal">DB_LOCK_MAXWRITE</code>
128 </p>
129 <p>
130 Reject the lock request for the locker ID with the most write locks.
131 </p>
132 </li>
133 <li>
134 <p><a id="detect_DB_LOCK_MINLOCKS"></a>
135 <code class="literal">DB_LOCK_MINLOCKS</code>
136 </p>
137 <p>
138 Reject the lock request for the locker ID with the fewest locks.
139 </p>
140 </li>
141 <li>
142 <p><a id="detect_DB_LOCK_MINWRITE"></a>
143 <code class="literal">DB_LOCK_MINWRITE</code>
144 </p>
145 <p>
146 Reject the lock request for the locker ID with the fewest write locks.
147 </p>
148 </li>
149 <li>
150 <p><a id="detect_DB_LOCK_OLDEST"></a>
151 <code class="literal">DB_LOCK_OLDEST</code>
152 </p>
153 <p>
154 Reject the lock request for the locker ID with the oldest lock.
155 </p>
156 </li>
157 <li>
158 <p><a id="detect_DB_LOCK_RANDOM"></a>
159 <code class="literal">DB_LOCK_RANDOM</code>
160 </p>
161 <p>
162 Reject the lock request for a random locker ID.
163 </p>
164 </li>
165 <li>
166 <p><a id="detect_DB_LOCK_YOUNGEST"></a>
167 <code class="literal">DB_LOCK_YOUNGEST</code>
168 </p>
169 <p>
170 Reject the lock request for the locker ID with the youngest lock.
171 </p>
172 </li>
173 </ul>
174 </div>
175 </div>
176 <div class="sect3" lang="en" xml:lang="en">
177 <div class="titlepage">
178 <div>
179 <div>
180 <h4 class="title"><a id="idp8047296"></a>rejected</h4>
181 </div>
182 </div>
183 </div>
184 <p>
185 If the <span class="bold"><strong>rejected</strong></span> parameter is
186 non-NULL, the memory location to which it refers will be set to the
187 number of lock requests that were rejected.
188 </p>
189 </div>
190 </div>
191 <div class="sect2" lang="en" xml:lang="en">
192 <div class="titlepage">
193 <div>
194 <div>
195 <h3 class="title"><a id="idp8012488"></a>Errors</h3>
196 </div>
197 </div>
198 </div>
199 <p>
200 The <code class="methodname">DbEnv::lock_detect()</code> <span>
201
202 <span>
203 method may fail and throw a <a class="link" href="dbexception.html" title="Chapter 6. The DbException Class">DbException</a>
204 exception, encapsulating one of the following non-zero errors, or return one
205 of the following non-zero errors:
206 </span>
207 </span>
208 </p>
209 <div class="sect3" lang="en" xml:lang="en">
210 <div class="titlepage">
211 <div>
212 <div>
213 <h4 class="title"><a id="idp8025848"></a>EINVAL</h4>
214 </div>
215 </div>
216 </div>
217 <p>
218 An invalid flag value or parameter was specified.
219 </p>
220 </div>
221 </div>
222 <div class="sect2" lang="en" xml:lang="en">
223 <div class="titlepage">
224 <div>
225 <div>
226 <h3 class="title"><a id="idp8040784"></a>Class</h3>
227 </div>
228 </div>
229 </div>
230 <p>
231 <a class="link" href="env.html" title="Chapter 5.  The DbEnv Handle">DbEnv</a>, <a class="link" href="lock.html" title="Chapter 7.  The DbLock Handle">DbLock</a>
232 </p>
233 </div>
234 <div class="sect2" lang="en" xml:lang="en">
235 <div class="titlepage">
236 <div>
237 <div>
238 <h3 class="title"><a id="idp8035464"></a>See Also</h3>
239 </div>
240 </div>
241 </div>
242 <p>
243 <a class="xref" href="lock.html#locklist" title="Locking Subsystem and Related Methods">Locking Subsystem and Related Methods</a>
244 </p>
245 </div>
246 </div>
247 <div class="navfooter">
248 <hr />
249 <table width="100%" summary="Navigation footer">
250 <tr>
251 <td width="40%" align="left"><a accesskey="p" href="envset_lk_tablesize.html">Prev</a> </td>
252 <td width="20%" align="center">
253 <a accesskey="u" href="lock.html">Up</a>
254 </td>
255 <td width="40%" align="right"> <a accesskey="n" href="lockget.html">Next</a></td>
256 </tr>
257 <tr>
258 <td width="40%" align="left" valign="top">DbEnv::set_lk_tablesize() </td>
259 <td width="20%" align="center">
260 <a accesskey="h" href="index.html">Home</a>
261 </td>
262 <td width="40%" align="right" valign="top"> DbEnv::lock_get()</td>
263 </tr>
264 </table>
265 </div>
266 </body>
267 </html>