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>DB_ENV->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->repmgr_stat_print()" />
12
<link rel="next" href="txnset_commit_token.html" title="DB_TXN->set_commit_token()" />
15
<div class="navheader">
16
<table width="100%" summary="Navigation header">
18
<th colspan="3" align="center">DB_ENV->txn_applied()</th>
21
<td width="20%" align="left"><a accesskey="p" href="repmgrstat_print.html">Prev</a> </td>
22
<th width="60%" align="center">Chapter 10.
25
<td width="20%" align="right"> <a accesskey="n" href="txnset_commit_token.html">Next</a></td>
30
<div class="sect1" lang="en" xml:lang="en">
31
<div class="titlepage">
34
<h2 class="title" style="clear: both"><a id="envtxn_applied"></a>DB_ENV->txn_applied()</h2>
38
<pre class="programlisting">#include <db.h>
41
DB_ENV->txn_applied(DB_ENV *env, DB_TXN_TOKEN *token,
42
db_timeout_t timeout, u_int32_t flags); </pre>
44
The <code class="methodname">DB_ENV->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.
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>.
58
The <code class="methodname">DB_ENV->txn_applied()</code> method may not be
59
called before the <a class="xref" href="envopen.html" title="DB_ENV->open()">DB_ENV->open()</a>
63
The <code class="methodname">DB_ENV->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:
68
<div class="itemizedlist">
72
<code class="literal">DB_TIMEOUT</code>
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>.
84
<code class="literal">DB_NOTFOUND</code>
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
95
<div class="sect2" lang="en" xml:lang="en">
96
<div class="titlepage">
99
<h3 class="title"><a id="id3899116"></a>Parameters</h3>
103
<div class="sect3" lang="en" xml:lang="en">
104
<div class="titlepage">
107
<h4 class="title"><a id="id3899517"></a>flags</h4>
112
The <span class="bold"><strong>flags</strong></span> parameter is
113
currently unused, and must be set to 0.
116
<div class="sect3" lang="en" xml:lang="en">
117
<div class="titlepage">
120
<h4 class="title"><a id="id3899880"></a>token</h4>
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->set_commit_token()">DB_TXN->set_commit_token()</a>
132
<div class="sect3" lang="en" xml:lang="en">
133
<div class="titlepage">
136
<h4 class="title"><a id="id3899899"></a>timeout</h4>
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.
148
<div class="sect2" lang="en" xml:lang="en">
149
<div class="titlepage">
152
<h3 class="title"><a id="id3899822"></a>Errors</h3>
157
The <code class="methodname">DB_ENV->txn_applied()</code> <span>
159
method may fail and return one of the following non-zero errors:
164
<div class="sect3" lang="en" xml:lang="en">
165
<div class="titlepage">
168
<h4 class="title"><a id="id3898960"></a>DB_KEYEMPTY</h4>
173
The specified token was generated by a transaction that did
174
not modify the database environment (for example, a read-only
178
<div class="sect3" lang="en" xml:lang="en">
179
<div class="titlepage">
182
<h4 class="title"><a id="id3900055"></a> DB_LOCK_DEADLOCK</h4>
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
194
<div class="sect3" lang="en" xml:lang="en">
195
<div class="titlepage">
198
<h4 class="title"><a id="id3900066"></a>EINVAL</h4>
203
If the specified token was generated from a non-replicated
204
database environment.
208
<div class="sect2" lang="en" xml:lang="en">
209
<div class="titlepage">
212
<h3 class="title"><a id="id3899758"></a>Class</h3>
217
<a class="link" href="env.html" title="Chapter 5. The DB_ENV Handle">DB_ENV</a>
220
<div class="sect2" lang="en" xml:lang="en">
221
<div class="titlepage">
224
<h3 class="title"><a id="id3899774"></a>See Also</h3>
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>
234
<div class="navfooter">
236
<table width="100%" summary="Navigation footer">
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>
242
<td width="40%" align="right"> <a accesskey="n" href="txnset_commit_token.html">Next</a></td>
245
<td width="40%" align="left" valign="top">DB_ENV->repmgr_stat_print() </td>
246
<td width="20%" align="center">
247
<a accesskey="h" href="index.html">Home</a>
249
<td width="40%" align="right" valign="top"> DB_TXN->set_commit_token()</td>