Imported Upstream version 5.3.21
[platform/upstream/libdb.git] / docs / api_reference / CXX / repsync.html
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_sync()</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="repstat_print.html" title="DbEnv::rep_stat_print()" />
12     <link rel="next" href="repmgr_channel.html" title="DbEnv::repmgr_channel()" />
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_sync()</th>
22         </tr>
23         <tr>
24           <td width="20%" align="left"><a accesskey="p" href="repstat_print.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="repmgr_channel.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="repsync"></a>DbEnv::rep_sync()</h2>
38           </div>
39         </div>
40       </div>
41       <pre class="programlisting">#include &lt;db_cxx.h&gt;
42  
43 int
44 DbEnv::rep_sync(u_int32_t flags);</pre>
45       <p>
46          The <code class="methodname">DbEnv::rep_sync()</code> method forces master synchronization to begin
47          for this client.  This method is the other half of setting the 
48          <a class="link" href="repconfig.html#config_DB_REP_CONF_DELAYCLIENT">DB_REP_CONF_DELAYCLIENT</a> 
49          flag via the <a class="xref" href="repconfig.html" title="DbEnv::rep_set_config()">DbEnv::rep_set_config()</a> 
50          method.
51     </p>
52       <p>
53          If an application has configured delayed master synchronization, the
54          application must synchronize explicitly (otherwise the client will
55          remain out-of-date and will ignore all database changes forwarded from
56          the replication group master).  The <code class="methodname">DbEnv::rep_sync()</code> method may be
57          called any time after the client application learns that the new
58          master has been established (by receiving a 
59          <a class="link" href="envevent_notify.html#event_notify_DB_EVENT_REP_NEWMASTER">DB_EVENT_REP_NEWMASTER</a> 
60          event notification).
61     </p>
62       <p>
63         Before calling this method, the enclosing database environment must
64         already have been opened by calling the 
65         <a class="xref" href="envopen.html" title="DbEnv::open()">DbEnv::open()</a> method and must
66         already have been configured to send replication messages by
67         calling the <a class="xref" href="reptransport.html" title="DbEnv::rep_set_transport()">DbEnv::rep_set_transport()</a> 
68         method.
69     </p>
70       <p>
71          The <code class="methodname">DbEnv::rep_sync()</code> <span>
72             
73             <span>
74                 method either returns a non-zero error value or throws an
75                 exception that encapsulates a non-zero error value on
76                 failure, and returns 0 on success.
77             </span>
78         </span>
79     </p>
80       <div class="sect2" lang="en" xml:lang="en">
81         <div class="titlepage">
82           <div>
83             <div>
84               <h3 class="title"><a id="idp4458936"></a>Parameters</h3>
85             </div>
86           </div>
87         </div>
88         <div class="sect3" lang="en" xml:lang="en">
89           <div class="titlepage">
90             <div>
91               <div>
92                 <h4 class="title"><a id="idp4466744"></a>flags</h4>
93               </div>
94             </div>
95           </div>
96           <p>
97                           The <span class="bold"><strong>flags</strong></span> parameter is currently
98                           unused, and must be set to 0.
99                      </p>
100         </div>
101       </div>
102       <div class="sect2" lang="en" xml:lang="en">
103         <div class="titlepage">
104           <div>
105             <div>
106               <h3 class="title"><a id="idp4447168"></a>Errors</h3>
107             </div>
108           </div>
109         </div>
110         <p>
111              The <code class="methodname">DbEnv::rep_sync()</code> <span>
112             
113             <span>
114                 method may fail and throw a <a class="link" href="dbexception.html" title="Chapter 6. The DbException Class">DbException</a> 
115                 exception, encapsulating one of the following non-zero errors, or return one
116                 of the following non-zero errors:
117             </span>
118         </span>
119          </p>
120         <div class="sect3" lang="en" xml:lang="en">
121           <div class="titlepage">
122             <div>
123               <div>
124                 <h4 class="title"><a id="idp4474784"></a>EINVAL</h4>
125               </div>
126             </div>
127           </div>
128           <p>
129 If the database environment was not already configured to communicate
130 with a replication group by a call to
131 <a class="xref" href="reptransport.html" title="DbEnv::rep_set_transport()">DbEnv::rep_set_transport()</a>;
132 the database environment was not already opened; 
133                  or if an invalid flag value or parameter was specified.
134              </p>
135         </div>
136       </div>
137       <div class="sect2" lang="en" xml:lang="en">
138         <div class="titlepage">
139           <div>
140             <div>
141               <h3 class="title"><a id="idp4476112"></a>Class</h3>
142             </div>
143           </div>
144         </div>
145         <p>
146                 <a class="link" href="env.html" title="Chapter 5.  The DbEnv Handle">DbEnv</a>  
147             </p>
148       </div>
149       <div class="sect2" lang="en" xml:lang="en">
150         <div class="titlepage">
151           <div>
152             <div>
153               <h3 class="title"><a id="idp4466896"></a>See Also</h3>
154             </div>
155           </div>
156         </div>
157         <p>
158                      <a class="xref" href="rep.html#replist" title="Replication and Related Methods">Replication and Related Methods</a> 
159                 </p>
160       </div>
161     </div>
162     <div class="navfooter">
163       <hr />
164       <table width="100%" summary="Navigation footer">
165         <tr>
166           <td width="40%" align="left"><a accesskey="p" href="repstat_print.html">Prev</a> </td>
167           <td width="20%" align="center">
168             <a accesskey="u" href="rep.html">Up</a>
169           </td>
170           <td width="40%" align="right"> <a accesskey="n" href="repmgr_channel.html">Next</a></td>
171         </tr>
172         <tr>
173           <td width="40%" align="left" valign="top">DbEnv::rep_stat_print() </td>
174           <td width="20%" align="center">
175             <a accesskey="h" href="index.html">Home</a>
176           </td>
177           <td width="40%" align="right" valign="top"> DbEnv::repmgr_channel()</td>
178         </tr>
179       </table>
180     </div>
181   </body>
182 </html>