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">
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()" />
15 <div xmlns="" class="navheader">
17 <p>Library Version 11.2.5.3</p>
19 <table width="100%" summary="Navigation header">
21 <th colspan="3" align="center">DbEnv::rep_sync()</th>
24 <td width="20%" align="left"><a accesskey="p" href="repstat_print.html">Prev</a> </td>
25 <th width="60%" align="center">Chapter 11.
28 <td width="20%" align="right"> <a accesskey="n" href="repmgr_channel.html">Next</a></td>
33 <div class="sect1" lang="en" xml:lang="en">
34 <div class="titlepage">
37 <h2 class="title" style="clear: both"><a id="repsync"></a>DbEnv::rep_sync()</h2>
41 <pre class="programlisting">#include <db_cxx.h>
44 DbEnv::rep_sync(u_int32_t flags);</pre>
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>
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>
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>
71 The <code class="methodname">DbEnv::rep_sync()</code> <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.
80 <div class="sect2" lang="en" xml:lang="en">
81 <div class="titlepage">
84 <h3 class="title"><a id="idp4458936"></a>Parameters</h3>
88 <div class="sect3" lang="en" xml:lang="en">
89 <div class="titlepage">
92 <h4 class="title"><a id="idp4466744"></a>flags</h4>
97 The <span class="bold"><strong>flags</strong></span> parameter is currently
98 unused, and must be set to 0.
102 <div class="sect2" lang="en" xml:lang="en">
103 <div class="titlepage">
106 <h3 class="title"><a id="idp4447168"></a>Errors</h3>
111 The <code class="methodname">DbEnv::rep_sync()</code> <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:
120 <div class="sect3" lang="en" xml:lang="en">
121 <div class="titlepage">
124 <h4 class="title"><a id="idp4474784"></a>EINVAL</h4>
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.
137 <div class="sect2" lang="en" xml:lang="en">
138 <div class="titlepage">
141 <h3 class="title"><a id="idp4476112"></a>Class</h3>
146 <a class="link" href="env.html" title="Chapter 5. The DbEnv Handle">DbEnv</a>
149 <div class="sect2" lang="en" xml:lang="en">
150 <div class="titlepage">
153 <h3 class="title"><a id="idp4466896"></a>See Also</h3>
158 <a class="xref" href="rep.html#replist" title="Replication and Related Methods">Replication and Related Methods</a>
162 <div class="navfooter">
164 <table width="100%" summary="Navigation footer">
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>
170 <td width="40%" align="right"> <a accesskey="n" href="repmgr_channel.html">Next</a></td>
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>
177 <td width="40%" align="right" valign="top"> DbEnv::repmgr_channel()</td>