• Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src/router/db-4.8.30/docs/api_reference/CXX/
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::set_lk_conflicts()</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="envget_lk_partitions.html" title="DbEnv::get_lk_partitions()" />
12    <link rel="next" href="envset_lk_detect.html" title="DbEnv::set_lk_detect()" />
13  </head>
14  <body>
15    <div class="navheader">
16      <table width="100%" summary="Navigation header">
17        <tr>
18          <th colspan="3" align="center">DbEnv::set_lk_conflicts()</th>
19        </tr>
20        <tr>
21          <td width="20%" align="left"><a accesskey="p" href="envget_lk_partitions.html">Prev</a> </td>
22          <th width="60%" align="center">Chapter 7. 
23                The DbLock Handle
24        </th>
25          <td width="20%" align="right"> <a accesskey="n" href="envset_lk_detect.html">Next</a></td>
26        </tr>
27      </table>
28      <hr />
29    </div>
30    <div class="sect1" lang="en" xml:lang="en">
31      <div class="titlepage">
32        <div>
33          <div>
34            <h2 class="title" style="clear: both"><a id="envset_lk_conflicts"></a>DbEnv::set_lk_conflicts()</h2>
35          </div>
36        </div>
37      </div>
38      <pre class="programlisting">#include &lt;db_cxx.h&gt;
39
40int
41DbEnv::set_lk_conflicts(u_int8_t *conflicts, int nmodes); </pre>
42      <p>
43        Set the locking conflicts matrix.
44    </p>
45      <p>
46         If <code class="methodname">DbEnv::set_lk_conflicts()</code> is never called, a standard conflicts
47         array is used; see <a href="../../programmer_reference/lock_stdmode.html" class="olink">Standard Lock Modes</a> for more information.
48    </p>
49      <p>
50         The <code class="methodname">DbEnv::set_lk_conflicts()</code> method configures a database
51         environment, not only operations performed using the specified 
52         <a class="link" href="env.html" title="Chapter 5.  The DbEnv Handle">DbEnv</a>  handle.
53    </p>
54      <p>
55         The <code class="methodname">DbEnv::set_lk_conflicts()</code> method may not be called after the
56         <a class="xref" href="envopen.html" title="DbEnv::open()">DbEnv::open()</a>  method is
57         called. If the database environment already exists when 
58         <a class="xref" href="envopen.html" title="DbEnv::open()">DbEnv::open()</a>  is called, the
59         information specified to <code class="methodname">DbEnv::set_lk_conflicts()</code> will be ignored.
60    </p>
61      <p>
62         The <code class="methodname">DbEnv::set_lk_conflicts()</code> <span>
63            
64            <span>
65                method either returns a non-zero error value or throws an
66                exception that encapsulates a non-zero error value on
67                failure, and returns 0 on success.
68            </span>
69        </span>
70    </p>
71      <div class="sect2" lang="en" xml:lang="en">
72        <div class="titlepage">
73          <div>
74            <div>
75              <h3 class="title"><a id="id1679468"></a>Parameters</h3>
76            </div>
77          </div>
78        </div>
79        <div class="sect3" lang="en" xml:lang="en">
80          <div class="titlepage">
81            <div>
82              <div>
83                <h4 class="title"><a id="id1679473"></a>conflicts</h4>
84              </div>
85            </div>
86          </div>
87          <p>
88                          The <span class="bold"><strong>conflicts</strong></span> parameter is the new
89                          locking conflicts matrix. The <span class="bold"><strong>conflicts</strong></span>
90                          parameter is an <span class="bold"><strong>nmodes</strong></span> by 
91                          <span class="bold"><strong>nmodes</strong></span> array.  A non-0 value for the array
92                          element indicates that requested_mode and held_mode conflict:
93                     </p>
94          <pre class="programlisting">        conflicts[requested_mode][held_mode] </pre>
95          <p>
96                          The <span class="emphasis"><em>not-granted</em></span> mode must be represented by 0.
97                     </p>
98        </div>
99        <div class="sect3" lang="en" xml:lang="en">
100          <div class="titlepage">
101            <div>
102              <div>
103                <h4 class="title"><a id="id1679512"></a>nmodes</h4>
104              </div>
105            </div>
106          </div>
107          <p>
108                          The <span class="bold"><strong>nmodes</strong></span> parameter is the size of
109                          the lock conflicts matrix.
110                     </p>
111        </div>
112      </div>
113      <div class="sect2" lang="en" xml:lang="en">
114        <div class="titlepage">
115          <div>
116            <div>
117              <h3 class="title"><a id="id1679510"></a>Errors</h3>
118            </div>
119          </div>
120        </div>
121        <p>
122                         The <code class="methodname">DbEnv::set_lk_conflicts()</code> <span>
123            
124            <span>
125                method may fail and throw a <a class="link" href="dbexception.html" title="Chapter 6. The DbException Class">DbException</a> 
126                exception, encapsulating one of the following non-zero errors, or return one
127                of the following non-zero errors:
128            </span>
129        </span>
130                    </p>
131        <div class="sect3" lang="en" xml:lang="en">
132          <div class="titlepage">
133            <div>
134              <div>
135                <h4 class="title"><a id="id1679390"></a>EINVAL</h4>
136              </div>
137            </div>
138          </div>
139          <p>
140                If the method was called after <a class="xref" href="envopen.html" title="DbEnv::open()">DbEnv::open()</a> 
141                was called; or if an invalid flag value or parameter was specified.
142            </p>
143        </div>
144        <div class="sect3" lang="en" xml:lang="en">
145          <div class="titlepage">
146            <div>
147              <div>
148                <h4 class="title"><a id="id1679108"></a>ENOMEM</h4>
149              </div>
150            </div>
151          </div>
152          <p>
153                            The conflicts array could not be copied.
154                        </p>
155        </div>
156      </div>
157      <div class="sect2" lang="en" xml:lang="en">
158        <div class="titlepage">
159          <div>
160            <div>
161              <h3 class="title"><a id="id1679680"></a>Class</h3>
162            </div>
163          </div>
164        </div>
165        <p>
166                    <a class="link" href="env.html" title="Chapter 5.  The DbEnv Handle">DbEnv</a>, 
167                    <a class="link" href="lock.html" title="Chapter 7.  The DbLock Handle">DbLock</a> 
168            </p>
169      </div>
170      <div class="sect2" lang="en" xml:lang="en">
171        <div class="titlepage">
172          <div>
173            <div>
174              <h3 class="title"><a id="id1679076"></a>See Also</h3>
175            </div>
176          </div>
177        </div>
178        <p>
179                     <a class="xref" href="lock.html#locklist" title="Locking Subsystem and Related Methods">Locking Subsystem and Related Methods</a> 
180                </p>
181      </div>
182    </div>
183    <div class="navfooter">
184      <hr />
185      <table width="100%" summary="Navigation footer">
186        <tr>
187          <td width="40%" align="left"><a accesskey="p" href="envget_lk_partitions.html">Prev</a> </td>
188          <td width="20%" align="center">
189            <a accesskey="u" href="lock.html">Up</a>
190          </td>
191          <td width="40%" align="right"> <a accesskey="n" href="envset_lk_detect.html">Next</a></td>
192        </tr>
193        <tr>
194          <td width="40%" align="left" valign="top">DbEnv::get_lk_partitions() </td>
195          <td width="20%" align="center">
196            <a accesskey="h" href="index.html">Home</a>
197          </td>
198          <td width="40%" align="right" valign="top"> DbEnv::set_lk_detect()</td>
199        </tr>
200      </table>
201    </div>
202  </body>
203</html>
204