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: DB_ENV->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>DB_ENV->set_lk_conflicts</b> 14</td> 15<td align=right> 16<a href="../api_c/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.h> 23<p> 24int 25DB_ENV->set_lk_conflicts(DB_ENV *dbenv, 26 u_int8_t *conflicts, int nmodes); 27<p> 28int 29DB_ENV->get_lk_conflicts(DB_ENV *dbenv, 30 const u_int8_t **lk_conflictsp, int *lk_modesp); 31</pre></b> 32<hr size=1 noshade> 33<b>Description: DB_ENV->set_lk_conflicts</b> 34<p>Set the locking conflicts matrix.</p> 35<p>If DB_ENV->set_lk_conflicts is never called, a standard conflicts 36array is used; see <a href="../ref/lock/stdmode.html">Standard Lock 37Modes</a> for more information.</p> 38<p>The DB_ENV->set_lk_conflicts method configures a database environment, not only operations 39performed using the specified <a href="../api_c/env_class.html">DB_ENV</a> handle.</p> 40<p>The DB_ENV->set_lk_conflicts method may not be called after the <a href="../api_c/env_open.html">DB_ENV->open</a> method is 41called. 42If the database environment already exists when 43<a href="../api_c/env_open.html">DB_ENV->open</a> is called, the information specified to DB_ENV->set_lk_conflicts 44will be ignored. 45</p> 46<p>The DB_ENV->set_lk_conflicts method 47returns a non-zero error value on failure 48and 0 on success. 49</p> 50<b>Parameters</b> <br> 51 <b>conflicts</b><ul compact><li>The <b>conflicts</b> parameter is the new locking conflicts matrix. 52The <b>conflicts</b> parameter is an <b>nmodes</b> by <b>nmodes</b> 53array. A non-0 value for the array element indicates that 54requested_mode and held_mode conflict: 55<blockquote><pre>conflicts[requested_mode][held_mode]</pre></blockquote> 56<p>The <i>not-granted</i> mode must be represented by 0.</p></ul> 57 <b>nmodes</b><ul compact><li>The <b>nmodes</b> parameter is the size of the lock conflicts matrix.</ul> 58<br> 59<br><b>Errors</b> 60<p>The DB_ENV->set_lk_conflicts method 61may fail and return one of the following non-zero errors:</p> 62<br> 63<b>EINVAL</b><ul compact><li>If the method was called after <a href="../api_c/env_open.html">DB_ENV->open</a> was called; or if an 64invalid flag value or parameter was specified.</ul> 65<br> 66<br> 67<b>ENOMEM</b><ul compact><li>The conflicts array could not be copied.</ul> 68<br> 69<hr size=1 noshade> 70<b>Description: dbenv_get_lk_conflicts</b> 71<p>The DB_ENV->get_lk_conflicts method returns the current conflicts array.</p> 72<p>The DB_ENV->get_lk_conflicts method may be called at any time during the life of the 73application.</p> 74<p>The DB_ENV->get_lk_conflicts method 75returns a non-zero error value on failure 76and 0 on success. 77</p> 78<b>Parameters</b> <br> 79 <b>lk_conflictsp</b><ul compact><li>The <b>lk_conflictsp</b> parameter references memory into which 80a pointer to the current conflicts array is copied.</ul> 81 <b>lk_modesp</b><ul compact><li>The <b>lk_modesp</b> parameter references memory into which 82 the size of the current conflicts array is copied.</ul> 83<br> 84<hr size=1 noshade> 85<br><b>Class</b> 86<a href="../api_c/env_class.html">DB_ENV</a>, <a href="../api_c/lock_class.html">DB_LOCK</a> 87<br><b>See Also</b> 88<a href="../api_c/lock_list.html">Locking Subsystem and Related Methods</a> 89</tt> 90<table width="100%"><tr><td><br></td><td align=right> 91<a href="../api_c/api_core.html"><img src="../images/api.gif" alt="API"></a><a href="../ref/toc.html"><img src="../images/ref.gif" alt="Ref"></a> 92</td></tr></table> 93<p><font size=1>Copyright (c) 1996,2008 Oracle. All rights reserved.</font> 94</body> 95</html> 96