1<!--$Id: rep_priority.so,v 1.3 2008/01/30 20:14:30 sue 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::rep_set_priority</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::rep_set_priority</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 &lt;db_cxx.h&gt;
23<p>
24int
25DbEnv::rep_set_priority(u_int32_t priority);
26int
27DbEnv::rep_get_priority(u_int32_t *priorityp);
28</pre></b>
29<hr size=1 noshade>
30<b>Description: DbEnv::rep_set_priority</b>
31<p>The DbEnv::rep_set_priority method specifies the database environment's
32priority in replication group elections.  A special value of
330 indicates that this environment cannot be a replication
34group master.</p>
35<p>The database environment's replication subsystem may also be configured using the
36environment's <a href="../ref/env/db_config.html#DB_CONFIG">DB_CONFIG</a> file.  The syntax of the entry in that
37file is a single line with the string "rep_set_priority", one or more whitespace
38characters, and the priority of this site.
39For example, "rep_set_priority 1" sets the priority of this site to 1.
40Because the <a href="../ref/env/db_config.html#DB_CONFIG">DB_CONFIG</a> file is read when the database environment
41is opened, it will silently overrule configuration done before that
42time.</p>
43<p>The DbEnv::rep_set_priority method configures a database environment, not only operations
44performed using the specified <a href="../api_cxx/env_class.html">DbEnv</a> handle.</p>
45<p>The DbEnv::rep_set_priority method may be called at any time during the life of the
46application.</p>
47<p>The DbEnv::rep_set_priority method
48either returns a non-zero error value
49or throws an exception that encapsulates a non-zero error value on
50failure, and returns 0 on success.
51</p>
52<b>Parameters</b> <br>
53 <b>priority</b><ul compact><li>The priority of this database environment in the replication group.  The
54priority must be a non-zero integer, or 0 if this environment cannot be
55a replication group master.  (See <a href="../ref/rep/pri.html">Replication environment priorities</a> for more information).</ul>
56<br>
57<hr size=1 noshade>
58<b>Description: DbEnv::rep_get_priority</b>
59<p>The DbEnv::rep_get_priority method returns the database environment priority.</p>
60<p>The DbEnv::rep_get_priority method may be called at any time during the life of the
61application.</p>
62<p>The DbEnv::rep_get_priority method
63either returns a non-zero error value
64or throws an exception that encapsulates a non-zero error value on
65failure, and returns 0 on success.
66</p>
67<b>Parameters</b> <br>
68 <b>priorityp</b><ul compact><li>The DbEnv::rep_get_priority method returns  the
69database environment priority in <b>priorityp</b>.</ul>
70<br>
71<hr size=1 noshade>
72<br><b>Class</b>
73<a href="../api_cxx/env_class.html">DbEnv</a>
74<br><b>See Also</b>
75<a href="../api_cxx/rep_list.html">Replication and Related Methods</a>
76</tt>
77<table width="100%"><tr><td><br></td><td align=right>
78<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>
79</td></tr></table>
80<p><font size=1>Copyright (c) 1996,2008 Oracle.  All rights reserved.</font>
81</body>
82</html>
83