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