~ubuntu-branches/ubuntu/saucy/db/saucy-proposed

« back to all changes in this revision

Viewing changes to docs/api_reference/C/envtxn_applied.html

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson
  • Date: 2010-10-25 22:16:35 UTC
  • mfrom: (13.1.11 sid)
  • Revision ID: james.westby@ubuntu.com-20101025221635-k0o38lxdx9kle3mh
Tags: 5.0.26-3ubuntu1
* Resynchronise with Debian.  Remaining changes:
  - Pass --build/--host to configure to support cross-building, and don't
    override CC.
  - Disable the Java build when cross-building, for now.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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;txn_applied()</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="repmgrstat_print.html" title="DB_ENV-&gt;repmgr_stat_print()" />
 
12
    <link rel="next" href="txnset_commit_token.html" title="DB_TXN-&gt;set_commit_token()" />
 
13
  </head>
 
14
  <body>
 
15
    <div class="navheader">
 
16
      <table width="100%" summary="Navigation header">
 
17
        <tr>
 
18
          <th colspan="3" align="center">DB_ENV-&gt;txn_applied()</th>
 
19
        </tr>
 
20
        <tr>
 
21
          <td width="20%" align="left"><a accesskey="p" href="repmgrstat_print.html">Prev</a> </td>
 
22
          <th width="60%" align="center">Chapter 10. 
 
23
                Replication Methods
 
24
        </th>
 
25
          <td width="20%" align="right"> <a accesskey="n" href="txnset_commit_token.html">Next</a></td>
 
26
        </tr>
 
27
      </table>
 
28
      <hr />
 
29
    </div>
 
30
    <div class="sect1" lang="en" xml:lang="en">
 
31
      <div class="titlepage">
 
32
        <div>
 
33
          <div>
 
34
            <h2 class="title" style="clear: both"><a id="envtxn_applied"></a>DB_ENV-&gt;txn_applied()</h2>
 
35
          </div>
 
36
        </div>
 
37
      </div>
 
38
      <pre class="programlisting">#include &lt;db.h&gt;
 
39
 
 
40
int
 
41
DB_ENV-&gt;txn_applied(DB_ENV *env, DB_TXN_TOKEN *token, 
 
42
                    db_timeout_t timeout, u_int32_t flags);  </pre>
 
43
      <p>
 
44
        The <code class="methodname">DB_ENV-&gt;txn_applied()</code> method checks to
 
45
        see if a specified transaction has been replicated from the master
 
46
        of a replication group. It may be called by applications using
 
47
        either the Base API or the Replication Manager.
 
48
    </p>
 
49
      <p>
 
50
        If the transaction has not yet arrived, this method will block for
 
51
        the amount of time specified on the <code class="literal">timeout</code>
 
52
        parameter while it waits for the result to be determined.  For more
 
53
        information, please refer to the
 
54
        <a href="../../programmer_reference/rep_ryw.html" class="olink">Read your writes consistency</a>
 
55
        section in the <em class="citetitle">Berkeley DB Programmer's Reference Guide</em>.
 
56
    </p>
 
57
      <p>
 
58
        The <code class="methodname">DB_ENV-&gt;txn_applied()</code> method may not be
 
59
        called before the <a class="xref" href="envopen.html" title="DB_ENV-&gt;open()">DB_ENV-&gt;open()</a>
 
60
        method.
 
61
    </p>
 
62
      <p>
 
63
        The <code class="methodname">DB_ENV-&gt;txn_applied()</code> method returns a
 
64
        non-zero error on failure and 0 to indicate that the specified
 
65
        transaction has been applied at the local site. It may also return
 
66
        one of the following non-zero return codes:
 
67
    </p>
 
68
      <div class="itemizedlist">
 
69
        <ul type="disc">
 
70
          <li>
 
71
            <p>
 
72
                <code class="literal">DB_TIMEOUT</code>
 
73
            </p>
 
74
            <p>
 
75
                 Returned if the specified transaction has not yet arrived
 
76
                 at the calling site, but can be expected to arrive soon.
 
77
                 If a non-zero timeout parameter is given, the this method
 
78
                 always waits for the specified amount of time before
 
79
                 returning <code class="literal">DB_TIMEOUT</code>.
 
80
            </p>
 
81
          </li>
 
82
          <li>
 
83
            <p>
 
84
                <code class="literal">DB_NOTFOUND</code>
 
85
            </p>
 
86
            <p>
 
87
                Returned if the transaction is expected to never arrive.
 
88
                This occurs if the transaction has not been applied at the
 
89
                local site because the transaction has been rolled back due
 
90
                to a master takeover.
 
91
            </p>
 
92
          </li>
 
93
        </ul>
 
94
      </div>
 
95
      <div class="sect2" lang="en" xml:lang="en">
 
96
        <div class="titlepage">
 
97
          <div>
 
98
            <div>
 
99
              <h3 class="title"><a id="id3899116"></a>Parameters</h3>
 
100
            </div>
 
101
          </div>
 
102
        </div>
 
103
        <div class="sect3" lang="en" xml:lang="en">
 
104
          <div class="titlepage">
 
105
            <div>
 
106
              <div>
 
107
                <h4 class="title"><a id="id3899517"></a>flags</h4>
 
108
              </div>
 
109
            </div>
 
110
          </div>
 
111
          <p>
 
112
                 The <span class="bold"><strong>flags</strong></span> parameter is
 
113
                 currently unused, and must be set to 0.
 
114
             </p>
 
115
        </div>
 
116
        <div class="sect3" lang="en" xml:lang="en">
 
117
          <div class="titlepage">
 
118
            <div>
 
119
              <div>
 
120
                <h4 class="title"><a id="id3899880"></a>token</h4>
 
121
              </div>
 
122
            </div>
 
123
          </div>
 
124
          <p>
 
125
                 A pointer to a buffer containing a copy of a commit token
 
126
                 previously generated at the replication group's master 
 
127
                 environment. Commit tokens are created using the 
 
128
                 <a class="xref" href="txnset_commit_token.html" title="DB_TXN-&gt;set_commit_token()">DB_TXN-&gt;set_commit_token()</a>
 
129
                 method.
 
130
             </p>
 
131
        </div>
 
132
        <div class="sect3" lang="en" xml:lang="en">
 
133
          <div class="titlepage">
 
134
            <div>
 
135
              <div>
 
136
                <h4 class="title"><a id="id3899899"></a>timeout</h4>
 
137
              </div>
 
138
            </div>
 
139
          </div>
 
140
          <p>
 
141
                 Specifies the maximum time to wait for the transaction to
 
142
                 arrive by replication, expressed in microseconds.  
 
143
                 To check the status of the transaction
 
144
                 without waiting, provide a timeout value of 0.
 
145
             </p>
 
146
        </div>
 
147
      </div>
 
148
      <div class="sect2" lang="en" xml:lang="en">
 
149
        <div class="titlepage">
 
150
          <div>
 
151
            <div>
 
152
              <h3 class="title"><a id="id3899822"></a>Errors</h3>
 
153
            </div>
 
154
          </div>
 
155
        </div>
 
156
        <p>
 
157
             The <code class="methodname">DB_ENV-&gt;txn_applied()</code> <span>
 
158
            <span>
 
159
                 method may fail and return one of the following non-zero errors:
 
160
            </span>
 
161
            
 
162
        </span>
 
163
        </p>
 
164
        <div class="sect3" lang="en" xml:lang="en">
 
165
          <div class="titlepage">
 
166
            <div>
 
167
              <div>
 
168
                <h4 class="title"><a id="id3898960"></a>DB_KEYEMPTY</h4>
 
169
              </div>
 
170
            </div>
 
171
          </div>
 
172
          <p>
 
173
                The specified token was generated by a transaction that did
 
174
                not modify the database environment (for example, a read-only
 
175
                transaction).
 
176
            </p>
 
177
        </div>
 
178
        <div class="sect3" lang="en" xml:lang="en">
 
179
          <div class="titlepage">
 
180
            <div>
 
181
              <div>
 
182
                <h4 class="title"><a id="id3900055"></a> DB_LOCK_DEADLOCK</h4>
 
183
              </div>
 
184
            </div>
 
185
          </div>
 
186
          <p>
 
187
                While waiting for the result to be determined, the API
 
188
                became locked out due to replication role change and/or
 
189
                master/client synchronization.  The application should
 
190
                abort in-flight transactions, pause briefly, and then
 
191
                retry.
 
192
            </p>
 
193
        </div>
 
194
        <div class="sect3" lang="en" xml:lang="en">
 
195
          <div class="titlepage">
 
196
            <div>
 
197
              <div>
 
198
                <h4 class="title"><a id="id3900066"></a>EINVAL</h4>
 
199
              </div>
 
200
            </div>
 
201
          </div>
 
202
          <p>
 
203
                If the specified token was generated from a non-replicated
 
204
                database environment.
 
205
            </p>
 
206
        </div>
 
207
      </div>
 
208
      <div class="sect2" lang="en" xml:lang="en">
 
209
        <div class="titlepage">
 
210
          <div>
 
211
            <div>
 
212
              <h3 class="title"><a id="id3899758"></a>Class</h3>
 
213
            </div>
 
214
          </div>
 
215
        </div>
 
216
        <p>
 
217
                 <a class="link" href="env.html" title="Chapter 5.  The DB_ENV Handle">DB_ENV</a> 
 
218
            </p>
 
219
      </div>
 
220
      <div class="sect2" lang="en" xml:lang="en">
 
221
        <div class="titlepage">
 
222
          <div>
 
223
            <div>
 
224
              <h3 class="title"><a id="id3899774"></a>See Also</h3>
 
225
            </div>
 
226
          </div>
 
227
        </div>
 
228
        <p>
 
229
                    <a class="xref" href="txn.html#txnlist" title="Transaction Subsystem and Related Methods">Transaction Subsystem and Related Methods</a>,
 
230
                    <a class="xref" href="rep.html#replist" title="Replication and Related Methods">Replication and Related Methods</a>
 
231
                </p>
 
232
      </div>
 
233
    </div>
 
234
    <div class="navfooter">
 
235
      <hr />
 
236
      <table width="100%" summary="Navigation footer">
 
237
        <tr>
 
238
          <td width="40%" align="left"><a accesskey="p" href="repmgrstat_print.html">Prev</a> </td>
 
239
          <td width="20%" align="center">
 
240
            <a accesskey="u" href="rep.html">Up</a>
 
241
          </td>
 
242
          <td width="40%" align="right"> <a accesskey="n" href="txnset_commit_token.html">Next</a></td>
 
243
        </tr>
 
244
        <tr>
 
245
          <td width="40%" align="left" valign="top">DB_ENV-&gt;repmgr_stat_print() </td>
 
246
          <td width="20%" align="center">
 
247
            <a accesskey="h" href="index.html">Home</a>
 
248
          </td>
 
249
          <td width="40%" align="right" valign="top"> DB_TXN-&gt;set_commit_token()</td>
 
250
        </tr>
 
251
      </table>
 
252
    </div>
 
253
  </body>
 
254
</html>