Debian Codegraph @

docs/api_reference/CXX/repstart.html

raw symbols SCIP
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>DbEnv::rep_start()</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="rep.html" title="Chapter 11.  Replication Methods" />
11 <link rel="prev" href="reptransport.html" title="DbEnv::rep_set_transport()" />
12 <link rel="next" href="repstat.html" title="DbEnv::rep_stat()" />
13 </head>
14 <body>
15 <div xmlns="" class="navheader">
16 <div class="libver">
17 <p>Library Version 11.2.5.3</p>
18 </div>
19 <table width="100%" summary="Navigation header">
20 <tr>
21 <th colspan="3" align="center">DbEnv::rep_start()</th>
22 </tr>
23 <tr>
24 <td width="20%" align="left"><a accesskey="p" href="reptransport.html">Prev</a> </td>
25 <th width="60%" align="center">Chapter 11. 
26 Replication Methods
27 </th>
28 <td width="20%" align="right"> <a accesskey="n" href="repstat.html">Next</a></td>
29 </tr>
30 </table>
31 <hr />
32 </div>
33 <div class="sect1" lang="en" xml:lang="en">
34 <div class="titlepage">
35 <div>
36 <div>
37 <h2 class="title" style="clear: both"><a id="repstart"></a>DbEnv::rep_start()</h2>
38 </div>
39 </div>
40 </div>
41 <pre class="programlisting">#include &lt;db_cxx.h&gt;
42
43 int
44 DbEnv::rep_start(Dbt *cdata, u_int32_t flags);</pre>
45 <p>
46 The <code class="methodname">DbEnv::rep_start()</code> method configures the database environment as
47 a client or master in a group of replicated database environments.
48 </p>
49 <p>
50 The <code class="methodname">DbEnv::rep_start()</code> method is not called by most replication
51 applications. It should only be called by Base API applications implementing
52 their own network transport layer, explicitly holding replication
53 group elections and handling replication messages outside of the
54 Replication Manager framework.
55 </p>
56 <p>
57 Replication master environments are the only database environments
58 where replicated databases may be modified. Replication client
59 environments are read-only as long as they are clients. Replication
60 client environments may be upgraded to be replication master
61 environments in the case that the current master fails or there is no
62 master present. If master leases are in use, this method cannot be
63 used to appoint a master, and should only be used to configure a database
64 environment as a master as the result of an election.
65 </p>
66 <p>
67 The enclosing database environment must already have been opened by
68 calling the <a class="xref" href="envopen.html" title="DbEnv::open()">DbEnv::open()</a> method and must
69 already have been configured to send replication messages by calling
70 the <a class="xref" href="reptransport.html" title="DbEnv::rep_set_transport()">DbEnv::rep_set_transport()</a>
71 method.
72 </p>
73 <p>
74 The <code class="methodname">DbEnv::rep_start()</code> <span>
75
76 <span>
77 method either returns a non-zero error value or throws an
78 exception that encapsulates a non-zero error value on
79 failure, and returns 0 on success.
80 </span>
81 </span>
82 </p>
83 <div class="sect2" lang="en" xml:lang="en">
84 <div class="titlepage">
85 <div>
86 <div>
87 <h3 class="title"><a id="idp9730056"></a>Parameters</h3>
88 </div>
89 </div>
90 </div>
91 <div class="sect3" lang="en" xml:lang="en">
92 <div class="titlepage">
93 <div>
94 <div>
95 <h4 class="title"><a id="idp9728912"></a>cdata</h4>
96 </div>
97 </div>
98 </div>
99 <p>
100 The <span class="bold"><strong>cdata</strong></span> parameter is an opaque data
101 item that is sent over the communication infrastructure when the client
102 comes online (see <a href="../../programmer_reference/rep_newsite.html" class="olink">Connecting to a new site</a> for more information). If no such information is useful,
103 <span class="bold"><strong>cdata</strong></span> should be NULL.
104 </p>
105 </div>
106 <div class="sect3" lang="en" xml:lang="en">
107 <div class="titlepage">
108 <div>
109 <div>
110 <h4 class="title"><a id="idp9695816"></a>flags</h4>
111 </div>
112 </div>
113 </div>
114 <p>
115 The <span class="bold"><strong>flags</strong></span> parameter must be set to
116 one of the following values:
117 </p>
118 <div class="itemizedlist">
119 <ul type="disc">
120 <li>
121 <p>
122 <code class="literal">DB_REP_CLIENT</code>
123 </p>
124 <p>
125 Configure the environment as a replication client.
126 </p>
127 </li>
128 <li>
129 <p>
130 <code class="literal">DB_REP_MASTER</code>
131 </p>
132 <p>
133 Configure the environment as a replication master.
134 </p>
135 </li>
136 </ul>
137 </div>
138 </div>
139 </div>
140 <div class="sect2" lang="en" xml:lang="en">
141 <div class="titlepage">
142 <div>
143 <div>
144 <h3 class="title"><a id="idp9738096"></a>Errors</h3>
145 </div>
146 </div>
147 </div>
148 <p>
149 The <code class="methodname">DbEnv::rep_start()</code> <span>
150
151 <span>
152 method may fail and throw a <a class="link" href="dbexception.html" title="Chapter 6. The DbException Class">DbException</a>
153 exception, encapsulating one of the following non-zero errors, or return one
154 of the following non-zero errors:
155 </span>
156 </span>
157 </p>
158 <div class="sect3" lang="en" xml:lang="en">
159 <div class="titlepage">
160 <div>
161 <div>
162 <h4 class="title"><a id="idp9746680"></a>DB_REP_UNAVAIL</h4>
163 </div>
164 </div>
165 </div>
166 <p>
167 If the flags parameter was passed as
168 DB_REP_MASTER but the database environment
169 cannot currently become the replication master
170 because it is temporarily initializing and is
171 incomplete.
172 </p>
173 </div>
174 <div class="sect3" lang="en" xml:lang="en">
175 <div class="titlepage">
176 <div>
177 <div>
178 <h4 class="title"><a id="idp9745600"></a>EINVAL</h4>
179 </div>
180 </div>
181 </div>
182 <p>
183 If the database environment was not already configured to communicate
184 with a replication group by a call to
185 <a class="xref" href="reptransport.html" title="DbEnv::rep_set_transport()">DbEnv::rep_set_transport()</a>;
186 the database environment was not already opened;
187 this method is called from a Replication Manager application; outstanding
188 master leases are granted; this method is used to appoint a new master when
189 master leases are in use; or if an invalid flag value or parameter was specified.
190 </p>
191 </div>
192 </div>
193 <div class="sect2" lang="en" xml:lang="en">
194 <div class="titlepage">
195 <div>
196 <div>
197 <h3 class="title"><a id="idp9742896"></a>Class</h3>
198 </div>
199 </div>
200 </div>
201 <p>
202 <a class="link" href="env.html" title="Chapter 5.  The DbEnv Handle">DbEnv</a>
203 </p>
204 </div>
205 <div class="sect2" lang="en" xml:lang="en">
206 <div class="titlepage">
207 <div>
208 <div>
209 <h3 class="title"><a id="idp9742680"></a>See Also</h3>
210 </div>
211 </div>
212 </div>
213 <p>
214 <a class="xref" href="rep.html#replist" title="Replication and Related Methods">Replication and Related Methods</a>
215 </p>
216 </div>
217 </div>
218 <div class="navfooter">
219 <hr />
220 <table width="100%" summary="Navigation footer">
221 <tr>
222 <td width="40%" align="left"><a accesskey="p" href="reptransport.html">Prev</a> </td>
223 <td width="20%" align="center">
224 <a accesskey="u" href="rep.html">Up</a>
225 </td>
226 <td width="40%" align="right"> <a accesskey="n" href="repstat.html">Next</a></td>
227 </tr>
228 <tr>
229 <td width="40%" align="left" valign="top">DbEnv::rep_set_transport() </td>
230 <td width="20%" align="center">
231 <a accesskey="h" href="index.html">Home</a>
232 </td>
233 <td width="40%" align="right" valign="top"> DbEnv::rep_stat()</td>
234 </tr>
235 </table>
236 </div>
237 </body>
238 </html>