• Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src-rt-6.x.4708/router/db-4.8.30/docs/programmer_reference/
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>Release 4.2: Replication</title>
7    <link rel="stylesheet" href="gettingStarted.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 Programmer's Reference Guide" />
10    <link rel="up" href="upgrade_4_2_toc.html" title="Chapter��39.��Upgrading Berkeley DB 4.1 applications to Berkeley DB 4.2" />
11    <link rel="prev" href="upgrade_4_2_lockng.html" title="Release 4.2: DB_LOCK_NOTGRANTED" />
12    <link rel="next" href="upgrade_4_2_nosync.html" title="Release 4.2: Client replication environments" />
13  </head>
14  <body>
15    <div class="navheader">
16      <table width="100%" summary="Navigation header">
17        <tr>
18          <th colspan="3" align="center">Release 4.2: Replication</th>
19        </tr>
20        <tr>
21          <td width="20%" align="left"><a accesskey="p" href="upgrade_4_2_lockng.html">Prev</a>��</td>
22          <th width="60%" align="center">Chapter��39.��Upgrading Berkeley DB 4.1 applications to Berkeley DB 4.2</th>
23          <td width="20%" align="right">��<a accesskey="n" href="upgrade_4_2_nosync.html">Next</a></td>
24        </tr>
25      </table>
26      <hr />
27    </div>
28    <div class="sect1" lang="en" xml:lang="en">
29      <div class="titlepage">
30        <div>
31          <div>
32            <h2 class="title" style="clear: both"><a id="upgrade_4_2_repinit"></a>Release 4.2: Replication</h2>
33          </div>
34        </div>
35      </div>
36      <div class="toc">
37        <dl>
38          <dt>
39            <span class="sect2">
40              <a href="upgrade_4_2_repinit.html#id1646262">Replication initialization</a>
41            </span>
42          </dt>
43          <dt>
44            <span class="sect2">
45              <a href="upgrade_4_2_repinit.html#id1645833">Database methods and replication clients</a>
46            </span>
47          </dt>
48          <dt>
49            <span class="sect2">
50              <a href="upgrade_4_2_repinit.html#id1645834">DB_ENV-&gt;rep_process_message()</a>
51            </span>
52          </dt>
53        </dl>
54      </div>
55      <div class="sect2" lang="en" xml:lang="en">
56        <div class="titlepage">
57          <div>
58            <div>
59              <h3 class="title"><a id="id1646262"></a>Replication initialization</h3>
60            </div>
61          </div>
62        </div>
63        <p>In the Berkeley DB 4.2 release, replication environments must be specifically
64initialized by any process that will ever do anything other than open
65databases in read-only mode (that is, any process which might call any
66of the Berkeley DB replication interfaces or modify databases).  This
67initialization is done when the replication database environment handle
68is opened, by specifying the <a href="../api_reference/C/envopen.html#open_DB_INIT_REP" class="olink">DB_INIT_REP</a> flag to the
69<a href="../api_reference/C/envopen.html" class="olink">DB_ENV-&gt;open()</a> method.</p>
70      </div>
71      <div class="sect2" lang="en" xml:lang="en">
72        <div class="titlepage">
73          <div>
74            <div>
75              <h3 class="title"><a id="id1645833"></a>Database methods and replication clients</h3>
76            </div>
77          </div>
78        </div>
79        <p>All of the <a href="../api_reference/C/db.html" class="olink">DB</a> object methods may now return
80<code class="literal">DB_REP_HANDLE_DEAD</code> when a replication client changes masters.
81When this happens the <a href="../api_reference/C/db.html" class="olink">DB</a> handle is no longer able to be used and
82the application must close the handle using the <a href="../api_reference/C/dbclose.html" class="olink">DB-&gt;close()</a> method and
83open a new handle.  This new return value is returned when a client
84unrolls a transaction in order to synchronize with the new master.
85Otherwise, if the application was permitted to use the original handle,
86it's possible the handle might attempt to access nonexistent resources.</p>
87      </div>
88      <div class="sect2" lang="en" xml:lang="en">
89        <div class="titlepage">
90          <div>
91            <div>
92              <h3 class="title"><a id="id1645834"></a><a href="../api_reference/C/repmessage.html" class="olink">DB_ENV-&gt;rep_process_message()</a></h3>
93            </div>
94          </div>
95        </div>
96        <p>The <a href="../api_reference/C/repmessage.html" class="olink">DB_ENV-&gt;rep_process_message()</a> method has new return values and an log sequence
97number (LSN) associated with those return values.  The new argument is
98<span class="bold"><strong>ret_lsnp</strong></span>, which is the returned LSN when the
99<a href="../api_reference/C/repmessage.html" class="olink">DB_ENV-&gt;rep_process_message()</a> method returns <a href="../api_reference/C/repmessage.html#repmsg_DB_REP_ISPERM" class="olink">DB_REP_ISPERM</a> or <a href="../api_reference/C/repmessage.html#repmsg_DB_REP_NOTPERM" class="olink">DB_REP_NOTPERM</a>. See
100<a class="xref" href="rep_trans.html" title="Transactional guarantees">Transactional guarantees</a> for more information.</p>
101      </div>
102    </div>
103    <div class="navfooter">
104      <hr />
105      <table width="100%" summary="Navigation footer">
106        <tr>
107          <td width="40%" align="left"><a accesskey="p" href="upgrade_4_2_lockng.html">Prev</a>��</td>
108          <td width="20%" align="center">
109            <a accesskey="u" href="upgrade_4_2_toc.html">Up</a>
110          </td>
111          <td width="40%" align="right">��<a accesskey="n" href="upgrade_4_2_nosync.html">Next</a></td>
112        </tr>
113        <tr>
114          <td width="40%" align="left" valign="top">Release 4.2: DB_LOCK_NOTGRANTED��</td>
115          <td width="20%" align="center">
116            <a accesskey="h" href="index.html">Home</a>
117          </td>
118          <td width="40%" align="right" valign="top">��Release 4.2: Client replication environments</td>
119        </tr>
120      </table>
121    </div>
122  </body>
123</html>
124