| 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>DB_ENV->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 6. The DB_LOCK Handle" /> |
| 11 | <link rel="prev" href="envget_lk_tablesize.html" title="DB_ENV->get_lk_tablesize()" /> |
| 12 | <link rel="next" href="envset_lk_detect.html" title="DB_ENV->set_lk_detect()" /> |
| 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">DB_ENV->set_lk_conflicts()</th> |
| 22 | </tr> |
| 23 | <tr> |
| 24 | <td width="20%" align="left"><a accesskey="p" href="envget_lk_tablesize.html">Prev</a> </td> |
| 25 | <th width="60%" align="center">Chapter 6. |
| 26 | The DB_LOCK Handle |
| 27 | </th> |
| 28 | <td width="20%" align="right"> <a accesskey="n" href="envset_lk_detect.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="envset_lk_conflicts"></a>DB_ENV->set_lk_conflicts()</h2> |
| 38 | </div> |
| 39 | </div> |
| 40 | </div> |
| 41 | <pre class="programlisting">#include <db.h> |
| 42 | |
| 43 | int |
| 44 | DB_ENV->set_lk_conflicts(DB_ENV *dbenv, |
| 45 | u_int8_t *conflicts, int nmodes); </pre> |
| 46 | <p> |
| 47 | Set the locking conflicts matrix. |
| 48 | </p> |
| 49 | <p> |
| 50 | If <code class="methodname">DB_ENV->set_lk_conflicts()</code> is never called, a standard conflicts |
| 51 | array is used; see <a href="../../programmer_reference/lock_stdmode.html" class="olink">Standard Lock Modes</a> for more information. |
| 52 | </p> |
| 53 | <p> |
| 54 | The <code class="methodname">DB_ENV->set_lk_conflicts()</code> method configures a database |
| 55 | environment, not only operations performed using the specified |
| 56 | <a class="link" href="env.html" title="Chapter 5. The DB_ENV Handle">DB_ENV</a> handle. |
| 57 | </p> |
| 58 | <p> |
| 59 | The <code class="methodname">DB_ENV->set_lk_conflicts()</code> method may not be called after the |
| 60 | <a class="xref" href="envopen.html" title="DB_ENV->open()">DB_ENV->open()</a> method is |
| 61 | called. If the database environment already exists when |
| 62 | <a class="xref" href="envopen.html" title="DB_ENV->open()">DB_ENV->open()</a> is called, the |
| 63 | information specified to <code class="methodname">DB_ENV->set_lk_conflicts()</code> will be ignored. |
| 64 | </p> |
| 65 | <p> |
| 66 | The <code class="methodname">DB_ENV->set_lk_conflicts()</code> <span> |
| 67 | <span> |
| 68 | method returns a non-zero error value on failure and 0 on success. |
| 69 | </span> |
| 70 | |
| 71 | </span> |
| 72 | </p> |
| 73 | <div class="sect2" lang="en" xml:lang="en"> |
| 74 | <div class="titlepage"> |
| 75 | <div> |
| 76 | <div> |
| 77 | <h3 class="title"><a id="idp52476088"></a>Parameters</h3> |
| 78 | </div> |
| 79 | </div> |
| 80 | </div> |
| 81 | <div class="sect3" lang="en" xml:lang="en"> |
| 82 | <div class="titlepage"> |
| 83 | <div> |
| 84 | <div> |
| 85 | <h4 class="title"><a id="idp52475440"></a>conflicts</h4> |
| 86 | </div> |
| 87 | </div> |
| 88 | </div> |
| 89 | <p> |
| 90 | The <span class="bold"><strong>conflicts</strong></span> parameter is the new |
| 91 | locking conflicts matrix. The <span class="bold"><strong>conflicts</strong></span> |
| 92 | parameter is an <span class="bold"><strong>nmodes</strong></span> by |
| 93 | <span class="bold"><strong>nmodes</strong></span> array. A non-0 value for the array |
| 94 | element indicates that requested_mode and held_mode conflict: |
| 95 | </p> |
| 96 | <pre class="programlisting"> conflicts[requested_mode][held_mode] </pre> |
| 97 | <p> |
| 98 | The <span class="emphasis"><em>not-granted</em></span> mode must be represented by 0. |
| 99 | </p> |
| 100 | </div> |
| 101 | <div class="sect3" lang="en" xml:lang="en"> |
| 102 | <div class="titlepage"> |
| 103 | <div> |
| 104 | <div> |
| 105 | <h4 class="title"><a id="idp52479016"></a>nmodes</h4> |
| 106 | </div> |
| 107 | </div> |
| 108 | </div> |
| 109 | <p> |
| 110 | The <span class="bold"><strong>nmodes</strong></span> parameter is the size of |
| 111 | the lock conflicts matrix. |
| 112 | </p> |
| 113 | </div> |
| 114 | </div> |
| 115 | <div class="sect2" lang="en" xml:lang="en"> |
| 116 | <div class="titlepage"> |
| 117 | <div> |
| 118 | <div> |
| 119 | <h3 class="title"><a id="idp52465904"></a>Errors</h3> |
| 120 | </div> |
| 121 | </div> |
| 122 | </div> |
| 123 | <p> |
| 124 | The <code class="methodname">DB_ENV->set_lk_conflicts()</code> <span> |
| 125 | <span> |
| 126 | method may fail and return one of the following non-zero errors: |
| 127 | </span> |
| 128 | |
| 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="idp52475224"></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="DB_ENV->open()">DB_ENV->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="idp52485800"></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="idp52483568"></a>Class</h3> |
| 162 | </div> |
| 163 | </div> |
| 164 | </div> |
| 165 | <p> |
| 166 | <a class="link" href="env.html" title="Chapter 5. The DB_ENV Handle">DB_ENV</a>, |
| 167 | <a class="link" href="lock.html" title="Chapter 6. The DB_LOCK Handle">DB_LOCK</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="idp52487136"></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_tablesize.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">DB_ENV->get_lk_tablesize() </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"> DB_ENV->set_lk_detect()</td> |
| 199 | </tr> |
| 200 | </table> |
| 201 | </div> |
| 202 | </body> |
| 203 | </html> |