1<!--$Id: env_set_lk_conflicts.so,v 10.43 2004/09/28 15:04:20 bostic Exp $--> 2<!--Copyright (c) 1997,2008 Oracle. All rights reserved.--> 3<!--See the file LICENSE for redistribution information.--> 4<html> 5<head> 6<title>Berkeley DB: DbEnv::set_lk_conflicts</title> 7<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit."> 8<meta name="keywords" content="embedded,database,programmatic,toolkit,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,Java,C,C++"> 9</head> 10<body bgcolor=white> 11<table width="100%"><tr valign=top> 12<td> 13<b>DbEnv::set_lk_conflicts</b> 14</td> 15<td align=right> 16<a href="../api_cxx/api_core.html"><img src="../images/api.gif" alt="API"></a> 17<a href="../ref/toc.html"><img src="../images/ref.gif" alt="Ref"></a></td> 18</tr></table> 19<hr size=1 noshade> 20<tt> 21<b><pre> 22#include <db_cxx.h> 23<p> 24int 25DbEnv::set_lk_conflicts(u_int8_t *conflicts, int nmodes); 26<p> 27int 28DbEnv::get_lk_conflicts(const u_int8_t **lk_conflictsp, int *lk_modesp); 29</pre></b> 30<hr size=1 noshade> 31<b>Description: DbEnv::set_lk_conflicts</b> 32<p>Set the locking conflicts matrix.</p> 33<p>If DbEnv::set_lk_conflicts is never called, a standard conflicts 34array is used; see <a href="../ref/lock/stdmode.html">Standard Lock 35Modes</a> for more information.</p> 36<p>The DbEnv::set_lk_conflicts method configures a database environment, not only operations 37performed using the specified <a href="../api_cxx/env_class.html">DbEnv</a> handle.</p> 38<p>The DbEnv::set_lk_conflicts method may not be called after the <a href="../api_cxx/env_open.html">DbEnv::open</a> method is 39called. 40If the database environment already exists when 41<a href="../api_cxx/env_open.html">DbEnv::open</a> is called, the information specified to DbEnv::set_lk_conflicts 42will be ignored. 43</p> 44<p>The DbEnv::set_lk_conflicts method 45either returns a non-zero error value 46or throws an exception that encapsulates a non-zero error value on 47failure, and returns 0 on success. 48</p> 49<b>Parameters</b> <br> 50 <b>conflicts</b><ul compact><li>The <b>conflicts</b> parameter is the new locking conflicts matrix. 51The <b>conflicts</b> parameter is an <b>nmodes</b> by <b>nmodes</b> 52array. A non-0 value for the array element indicates that 53requested_mode and held_mode conflict: 54<blockquote><pre>conflicts[requested_mode][held_mode]</pre></blockquote> 55<p>The <i>not-granted</i> mode must be represented by 0.</p></ul> 56 <b>nmodes</b><ul compact><li>The <b>nmodes</b> parameter is the size of the lock conflicts matrix.</ul> 57<br> 58<br><b>Errors</b> 59<p>The DbEnv::set_lk_conflicts method 60may fail and throw 61<a href="../api_cxx/except_class.html">DbException</a>, 62encapsulating one of the following non-zero errors, or return one of 63the following non-zero errors:</p> 64<br> 65<b>EINVAL</b><ul compact><li>If the method was called after <a href="../api_cxx/env_open.html">DbEnv::open</a> was called; or if an 66invalid flag value or parameter was specified.</ul> 67<br> 68<p>If the conflicts array could not be copied, the DbEnv::set_lk_conflicts method will fail and 69either return ENOMEM or 70throw a DbMemoryException.</p> 71<hr size=1 noshade> 72<b>Description: dbenv_get_lk_conflicts</b> 73<p>The DbEnv::get_lk_conflicts method returns the current conflicts array.</p> 74<p>The DbEnv::get_lk_conflicts method may be called at any time during the life of the 75application.</p> 76<p>The DbEnv::get_lk_conflicts method 77either returns a non-zero error value 78or throws an exception that encapsulates a non-zero error value on 79failure, and returns 0 on success. 80</p> 81<b>Parameters</b> <br> 82 <b>lk_conflictsp</b><ul compact><li>The <b>lk_conflictsp</b> parameter references memory into which 83a pointer to the current conflicts array is copied.</ul> 84 <b>lk_modesp</b><ul compact><li>The <b>lk_modesp</b> parameter references memory into which 85 the size of the current conflicts array is copied.</ul> 86<br> 87<hr size=1 noshade> 88<br><b>Class</b> 89<a href="../api_cxx/env_class.html">DbEnv</a>, <a href="../api_cxx/lock_class.html">DbLock</a> 90<br><b>See Also</b> 91<a href="../api_cxx/lock_list.html">Locking Subsystem and Related Methods</a> 92</tt> 93<table width="100%"><tr><td><br></td><td align=right> 94<a href="../api_cxx/api_core.html"><img src="../images/api.gif" alt="API"></a><a href="../ref/toc.html"><img src="../images/ref.gif" alt="Ref"></a> 95</td></tr></table> 96<p><font size=1>Copyright (c) 1996,2008 Oracle. All rights reserved.</font> 97</body> 98</html> 99