1<!--$Id: rep_config.so,v 1.10 2008/01/19 14:12:59 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-&gt;rep_set_config</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-&gt;rep_set_config</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 &lt;db.h&gt;
23<p>
24int
25DB_ENV-&gt;rep_set_config(DB_ENV *env, u_int32_t which, int onoff);
26<p>
27int
28DB_ENV-&gt;rep_get_config(DB_ENV *dbenv, u_int32_t which, int *onoffp);
29</pre></b>
30<hr size=1 noshade>
31<b>Description: DB_ENV-&gt;rep_set_config</b>
32<p>The DB_ENV-&gt;rep_set_config method method configures the Berkeley DB replication
33subsystem.</p>
34<p>The database environment's replication subsystem may also be configured using the
35environment's <a href="../ref/env/db_config.html#DB_CONFIG">DB_CONFIG</a> file.  The syntax of the entry in that
36file is a single line with the string "rep_set_config", one or more whitespace
37characters, and the method <b>which</b> parameter as a string; for example,
38"rep_set_config DB_REP_CONF_NOWAIT".
39Because the <a href="../ref/env/db_config.html#DB_CONFIG">DB_CONFIG</a> file is read when the database environment
40is opened, it will silently overrule configuration done before that
41time.</p>
42<p>The DB_ENV-&gt;rep_set_config method configures a database environment, not only operations
43performed using the specified <a href="../api_c/env_class.html">DB_ENV</a> handle.</p>
44<p>The DB_ENV-&gt;rep_set_config method may be called at any time during the life of the
45application.</p>
46<p>The DB_ENV-&gt;rep_set_config method
47returns a non-zero error value on failure
48and 0 on success.
49</p>
50<b>Parameters</b> <br>
51 <b>onoff</b><ul compact><li>If the <b>onoff</b> parameter is zero, the configuration flag is turned
52off.  Otherwise, it is turned on.</ul>
53 <b>which</b><ul compact><li>The <b>which</b> parameter must be set to one of the following values:
54<br>
55<b><a name="DB_REP_CONF_BULK">DB_REP_CONF_BULK</a></b><ul compact><li>The replication master sends groups of records to the clients in a
56single network transfer (defaults to off).</ul>
57<b><a name="DB_REP_CONF_DELAYCLIENT">DB_REP_CONF_DELAYCLIENT</a></b><ul compact><li>The client should delay synchronizing to a newly declared master
58(defaults to off).  Clients configured in this way will remain
59unsynchronized until the application calls the <a href="../api_c/rep_sync.html">DB_ENV-&gt;rep_sync</a> method.</ul>
60<b><a name="DB_REP_CONF_LEASE">DB_REP_CONF_LEASE</a></b><ul compact><li>Master leases will be used for this site (defaults to off).
61<p>Configuring this option may result in <a name="DB_REP_LEASE_EXPIRED">DB_REP_LEASE_EXPIRED</a>
62error returns from the <a href="../api_c/db_get.html">DB-&gt;get</a> and <a href="../api_c/dbc_get.html">DBcursor-&gt;get</a> methods when
63attempting to read entries from a database after the site's master lease
64has expired.</p>
65<p>The DB_ENV-&gt;rep_set_config method may not be called after the <a href="../api_c/repmgr_start.html">DB_ENV-&gt;repmgr_start</a> or <a href="../api_c/rep_start.html">DB_ENV-&gt;rep_start</a> methods are
66called.</p>
67Once this option is turned on, it may never be turned off.</ul>
68<b><a name="DB_REP_CONF_NOAUTOINIT">DB_REP_CONF_NOAUTOINIT</a></b><ul compact><li>The replication master will not automatically re-initialize outdated
69clients (defaults to off).</ul>
70<b><a name="DB_REP_CONF_NOWAIT">DB_REP_CONF_NOWAIT</a></b><ul compact><li>Berkeley DB method calls that would normally block while clients are in
71recovery will return errors immediately (defaults to off).</ul>
72<b><a name="DB_REPMGR_CONF_2SITE_STRICT">DB_REPMGR_CONF_2SITE_STRICT</a></b><ul compact><li>Replication Manager observes the strict "majority" rule in managing
73elections, even in a group with only 2 sites.  This means the client in
74a 2-site group will be unable to take over as master if the original
75master fails or becomes disconnected.  (See the
76<a href="../ref/rep/elect.html">Elections</a> section in the Berkeley DB
77Reference Guide for more information.)  Both sites in the replication
78group should have the same value for this parameter.</ul>
79<br></ul>
80<br>
81<br><b>Errors</b>
82<p>The DB_ENV-&gt;rep_set_config method
83may fail and return one of the following non-zero errors:</p>
84<br>
85<b>EINVAL</b><ul compact><li>An
86invalid flag value or parameter was specified.</ul>
87<br>
88<hr size=1 noshade>
89<b>Description: DB_ENV-&gt;rep_get_config</b>
90<p>The DB_ENV-&gt;rep_get_config method returns whether the specified <b>which</b>
91parameter is currently set or not.</p>
92<p>The DB_ENV-&gt;rep_get_config method may be called at any time during the life of the
93application.</p>
94<p>The DB_ENV-&gt;rep_get_config method
95returns a non-zero error value on failure
96and 0 on success.
97</p>
98<b>Parameters</b> <br>
99 <b>which</b><ul compact><li>The <b>which</b> parameter is the message value for which configuration
100is being checked.</ul>
101 <b>onoffp</b><ul compact><li>The <b>onoffp</b> parameter references memory into which
102 the configuration of the specified <b>which</b> parameter is copied.</ul> If the returned <b>onoff</b> value is zero, the parameter is off;
103otherwise on.
104<br>
105<hr size=1 noshade>
106<br><b>Class</b>
107<a href="../api_c/env_class.html">DB_ENV</a>
108<br><b>See Also</b>
109<a href="../api_c/rep_list.html">Replication and Related Methods</a>
110</tt>
111<table width="100%"><tr><td><br></td><td align=right>
112<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>
113</td></tr></table>
114<p><font size=1>Copyright (c) 1996,2008 Oracle.  All rights reserved.</font>
115</body>
116</html>
117