Debian Codegraph @

docs/api_reference/CXX/txnset_commit_token.html

raw symbols SCIP
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>DbTxn::set_commit_token()</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="envtxn_applied.html" title="DbEnv::txn_applied()" />
12 <link rel="next" href="seq.html" title="Chapter 12.  The DbSequence Handle" />
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">DbTxn::set_commit_token()</th>
22 </tr>
23 <tr>
24 <td width="20%" align="left"><a accesskey="p" href="envtxn_applied.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="seq.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="txnset_commit_token"></a>DbTxn::set_commit_token()</h2>
38 </div>
39 </div>
40 </div>
41 <pre class="programlisting">#include &lt;db_cxx.h&gt;
42
43 int
44 DbTxn::set_commit_token(DB_TXN_TOKEN *buffer);</pre>
45 <p>
46 The <code class="methodname">DbTxn::set_commit_token()</code> method
47 configures the transaction for commit token generation, and accepts
48 the address of an application-supplied buffer to receive the token.
49 The actual generation of the token contents does not occur until
50 commit time.
51 </p>
52 <p>
53 Commit tokens are used to enable some consistency guarantees for
54 replicated applications. Please see the
55 <a href="../../programmer_reference/rep_ryw.html" class="olink">Read your writes consistency</a>
56 section in the <em class="citetitle">Berkeley DB Programmer's Reference Guide</em>
57 for more information.
58 </p>
59 <p>
60 The <code class="methodname">DbTxn::set_commit_token()</code> method may be
61 called at any time after the
62 <a class="xref" href="txnbegin.html" title="DbEnv::txn_begin()">DbEnv::txn_begin()</a>
63 method has been called, and before
64 <a class="xref" href="txncommit.html" title="DbTxn::commit()">DbTxn::commit()</a>
65 has been called.
66 </p>
67 <p>
68 The <code class="methodname">DbTxn::set_commit_token()</code> <span>
69
70 <span>
71 method either returns a non-zero error value or throws an
72 exception that encapsulates a non-zero error value on
73 failure, and returns 0 on success.
74 </span>
75 </span>
76 </p>
77 <div class="sect2" lang="en" xml:lang="en">
78 <div class="titlepage">
79 <div>
80 <div>
81 <h3 class="title"><a id="idp10035808"></a>Parameters</h3>
82 </div>
83 </div>
84 </div>
85 <div class="sect3" lang="en" xml:lang="en">
86 <div class="titlepage">
87 <div>
88 <div>
89 <h4 class="title"><a id="idp10036408"></a>buffer</h4>
90 </div>
91 </div>
92 </div>
93 <p>
94 The address of an application-supplied buffer.
95 The buffer memory must remain available, and will
96 be filled in later by Berkeley DB, at the time of
97 the commit() call.
98 </p>
99 </div>
100 </div>
101 <div class="sect2" lang="en" xml:lang="en">
102 <div class="titlepage">
103 <div>
104 <div>
105 <h3 class="title"><a id="idp10037752"></a>Errors</h3>
106 </div>
107 </div>
108 </div>
109 <p>
110 The <code class="methodname">DbTxn::set_commit_token()</code> <span>
111
112 <span>
113 method may fail and throw a <a class="link" href="dbexception.html" title="Chapter 6. The DbException Class">DbException</a>
114 exception, encapsulating one of the following non-zero errors, or return one
115 of the following non-zero errors:
116 </span>
117 </span>
118 </p>
119 <div class="sect3" lang="en" xml:lang="en">
120 <div class="titlepage">
121 <div>
122 <div>
123 <h4 class="title"><a id="idp10041560"></a>EINVAL</h4>
124 </div>
125 </div>
126 </div>
127 <p>
128 If the transaction is a nested transaction; if
129 this method is called on a replication client;
130 if the database environment is not configured
131 for logging.
132 </p>
133 </div>
134 </div>
135 <div class="sect2" lang="en" xml:lang="en">
136 <div class="titlepage">
137 <div>
138 <div>
139 <h3 class="title"><a id="idp10039864"></a>Class</h3>
140 </div>
141 </div>
142 </div>
143 <p>
144 <a class="link" href="txn.html" title="Chapter 13.  The DbTxn Handle">DbTxn</a>
145 </p>
146 </div>
147 <div class="sect2" lang="en" xml:lang="en">
148 <div class="titlepage">
149 <div>
150 <div>
151 <h3 class="title"><a id="idp10023568"></a>See Also</h3>
152 </div>
153 </div>
154 </div>
155 <p>
156 <a class="xref" href="txn.html#txnlist" title="Transaction Subsystem and Related Methods">Transaction Subsystem and Related Methods</a>,
157 <a class="xref" href="rep.html#replist" title="Replication and Related Methods">Replication and Related Methods</a>
158 </p>
159 </div>
160 </div>
161 <div class="navfooter">
162 <hr />
163 <table width="100%" summary="Navigation footer">
164 <tr>
165 <td width="40%" align="left"><a accesskey="p" href="envtxn_applied.html">Prev</a> </td>
166 <td width="20%" align="center">
167 <a accesskey="u" href="rep.html">Up</a>
168 </td>
169 <td width="40%" align="right"> <a accesskey="n" href="seq.html">Next</a></td>
170 </tr>
171 <tr>
172 <td width="40%" align="left" valign="top">DbEnv::txn_applied() </td>
173 <td width="20%" align="center">
174 <a accesskey="h" href="index.html">Home</a>
175 </td>
176 <td width="40%" align="right" valign="top"> Chapter 12. 
177 The DbSequence Handle
178 </td>
179 </tr>
180 </table>
181 </div>
182 </body>
183 </html>