Debian Codegraph @

docs/api_reference/C/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>DB_ENV-&gt;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 10.  Replication Methods" />
11 <link rel="prev" href="reptransport.html" title="DB_ENV-&gt;rep_set_transport()" />
12 <link rel="next" href="repstat.html" title="DB_ENV-&gt;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">DB_ENV-&gt;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 10. 
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>DB_ENV-&gt;rep_start()</h2>
38 </div>
39 </div>
40 </div>
41 <pre class="programlisting">#include &lt;db.h&gt;
42
43 int
44 DB_ENV-&gt;rep_start(DB_ENV *env, DBT *cdata, u_int32_t flags); </pre>
45 <p>
46 The <code class="methodname">DB_ENV-&gt;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">DB_ENV-&gt;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="DB_ENV-&gt;open()">DB_ENV-&gt;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="DB_ENV-&gt;rep_set_transport()">DB_ENV-&gt;rep_set_transport()</a>
71 method.
72 </p>
73 <p>
74 The <code class="methodname">DB_ENV-&gt;rep_start()</code> <span>
75 <span>
76 method returns a non-zero error value on failure and 0 on success.
77 </span>
78
79 </span>
80 </p>
81 <div class="sect2" lang="en" xml:lang="en">
82 <div class="titlepage">
83 <div>
84 <div>
85 <h3 class="title"><a id="idp54219680"></a>Parameters</h3>
86 </div>
87 </div>
88 </div>
89 <div class="sect3" lang="en" xml:lang="en">
90 <div class="titlepage">
91 <div>
92 <div>
93 <h4 class="title"><a id="idp54211176"></a>cdata</h4>
94 </div>
95 </div>
96 </div>
97 <p>
98 The <span class="bold"><strong>cdata</strong></span> parameter is an opaque data
99 item that is sent over the communication infrastructure when the client
100 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,
101 <span class="bold"><strong>cdata</strong></span> should be NULL.
102 </p>
103 </div>
104 <div class="sect3" lang="en" xml:lang="en">
105 <div class="titlepage">
106 <div>
107 <div>
108 <h4 class="title"><a id="idp54248296"></a>flags</h4>
109 </div>
110 </div>
111 </div>
112 <p>
113 The <span class="bold"><strong>flags</strong></span> parameter must be set to
114 one of the following values:
115 </p>
116 <div class="itemizedlist">
117 <ul type="disc">
118 <li>
119 <p>
120 <code class="literal">DB_REP_CLIENT</code>
121 </p>
122 <p>
123 Configure the environment as a replication client.
124 </p>
125 </li>
126 <li>
127 <p>
128 <code class="literal">DB_REP_MASTER</code>
129 </p>
130 <p>
131 Configure the environment as a replication master.
132 </p>
133 </li>
134 </ul>
135 </div>
136 </div>
137 </div>
138 <div class="sect2" lang="en" xml:lang="en">
139 <div class="titlepage">
140 <div>
141 <div>
142 <h3 class="title"><a id="idp54237048"></a>Errors</h3>
143 </div>
144 </div>
145 </div>
146 <p>
147 The <code class="methodname">DB_ENV-&gt;rep_start()</code> <span>
148 <span>
149 method may fail and return one of the following non-zero errors:
150 </span>
151
152 </span>
153 </p>
154 <div class="sect3" lang="en" xml:lang="en">
155 <div class="titlepage">
156 <div>
157 <div>
158 <h4 class="title"><a id="idp54263552"></a>DB_REP_UNAVAIL</h4>
159 </div>
160 </div>
161 </div>
162 <p>
163 If the flags parameter was passed as
164 DB_REP_MASTER but the database environment
165 cannot currently become the replication master
166 because it is temporarily initializing and is
167 incomplete.
168 </p>
169 </div>
170 <div class="sect3" lang="en" xml:lang="en">
171 <div class="titlepage">
172 <div>
173 <div>
174 <h4 class="title"><a id="idp54263872"></a>EINVAL</h4>
175 </div>
176 </div>
177 </div>
178 <p>
179 If the database environment was not already configured to communicate
180 with a replication group by a call to
181 <a class="xref" href="reptransport.html" title="DB_ENV-&gt;rep_set_transport()">DB_ENV-&gt;rep_set_transport()</a>;
182 the database environment was not already opened;
183 this method is called from a Replication Manager application; outstanding
184 master leases are granted; this method is used to appoint a new master when
185 master leases are in use; or if an invalid flag value or parameter was specified.
186 </p>
187 </div>
188 </div>
189 <div class="sect2" lang="en" xml:lang="en">
190 <div class="titlepage">
191 <div>
192 <div>
193 <h3 class="title"><a id="idp54265024"></a>Class</h3>
194 </div>
195 </div>
196 </div>
197 <p>
198 <a class="link" href="env.html" title="Chapter 5.  The DB_ENV Handle">DB_ENV</a>
199 </p>
200 </div>
201 <div class="sect2" lang="en" xml:lang="en">
202 <div class="titlepage">
203 <div>
204 <div>
205 <h3 class="title"><a id="idp54175376"></a>See Also</h3>
206 </div>
207 </div>
208 </div>
209 <p>
210 <a class="xref" href="rep.html#replist" title="Replication and Related Methods">Replication and Related Methods</a>
211 </p>
212 </div>
213 </div>
214 <div class="navfooter">
215 <hr />
216 <table width="100%" summary="Navigation footer">
217 <tr>
218 <td width="40%" align="left"><a accesskey="p" href="reptransport.html">Prev</a> </td>
219 <td width="20%" align="center">
220 <a accesskey="u" href="rep.html">Up</a>
221 </td>
222 <td width="40%" align="right"> <a accesskey="n" href="repstat.html">Next</a></td>
223 </tr>
224 <tr>
225 <td width="40%" align="left" valign="top">DB_ENV-&gt;rep_set_transport() </td>
226 <td width="20%" align="center">
227 <a accesskey="h" href="index.html">Home</a>
228 </td>
229 <td width="40%" align="right" valign="top"> DB_ENV-&gt;rep_stat()</td>
230 </tr>
231 </table>
232 </div>
233 </body>
234 </html>