Debian Codegraph @

docs/api_reference/C/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>DB_TXN-&gt;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 10.  Replication Methods" />
11 <link rel="prev" href="envtxn_applied.html" title="DB_ENV-&gt;txn_applied()" />
12 <link rel="next" href="seq.html" title="Chapter 11.  The DB_SEQUENCE 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">DB_TXN-&gt;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 10. 
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>DB_TXN-&gt;set_commit_token()</h2>
38 </div>
39 </div>
40 </div>
41 <pre class="programlisting">#include &lt;db.h&gt;
42
43 int
44 DB_TXN-&gt;set_commit_token(DB_TXN *txn, DB_TXN_TOKEN *buffer); </pre>
45 <p>
46 The <code class="methodname">DB_TXN-&gt;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">DB_TXN-&gt;set_commit_token()</code> method may be
61 called at any time after the
62 <a class="xref" href="txnbegin.html" title="DB_ENV-&gt;txn_begin()">DB_ENV-&gt;txn_begin()</a>
63 method has been called, and before
64 <a class="xref" href="txncommit.html" title="DB_TXN-&gt;commit()">DB_TXN-&gt;commit()</a>
65 has been called.
66 </p>
67 <p>
68 The <code class="methodname">DB_TXN-&gt;set_commit_token()</code> <span>
69 <span>
70 method returns a non-zero error value on failure and 0 on success.
71 </span>
72
73 </span>
74 </p>
75 <div class="sect2" lang="en" xml:lang="en">
76 <div class="titlepage">
77 <div>
78 <div>
79 <h3 class="title"><a id="idp54536904"></a>Parameters</h3>
80 </div>
81 </div>
82 </div>
83 <div class="sect3" lang="en" xml:lang="en">
84 <div class="titlepage">
85 <div>
86 <div>
87 <h4 class="title"><a id="idp54526064"></a>buffer</h4>
88 </div>
89 </div>
90 </div>
91 <p>
92 The address of an application-supplied buffer.
93 The buffer memory must remain available, and will
94 be filled in later by Berkeley DB, at the time of
95 the commit() call.
96 </p>
97 </div>
98 </div>
99 <div class="sect2" lang="en" xml:lang="en">
100 <div class="titlepage">
101 <div>
102 <div>
103 <h3 class="title"><a id="idp54543856"></a>Errors</h3>
104 </div>
105 </div>
106 </div>
107 <p>
108 The <code class="methodname">DB_TXN-&gt;set_commit_token()</code> <span>
109 <span>
110 method may fail and return one of the following non-zero errors:
111 </span>
112
113 </span>
114 </p>
115 <div class="sect3" lang="en" xml:lang="en">
116 <div class="titlepage">
117 <div>
118 <div>
119 <h4 class="title"><a id="idp54516720"></a>EINVAL</h4>
120 </div>
121 </div>
122 </div>
123 <p>
124 If the transaction is a nested transaction; if
125 this method is called on a replication client;
126 if the database environment is not configured
127 for logging.
128 </p>
129 </div>
130 </div>
131 <div class="sect2" lang="en" xml:lang="en">
132 <div class="titlepage">
133 <div>
134 <div>
135 <h3 class="title"><a id="idp54546944"></a>Class</h3>
136 </div>
137 </div>
138 </div>
139 <p>
140 <a class="link" href="txn.html" title="Chapter 12.  The DB_TXN Handle">DB_TXN</a>
141 </p>
142 </div>
143 <div class="sect2" lang="en" xml:lang="en">
144 <div class="titlepage">
145 <div>
146 <div>
147 <h3 class="title"><a id="idp54548168"></a>See Also</h3>
148 </div>
149 </div>
150 </div>
151 <p>
152 <a class="xref" href="txn.html#txnlist" title="Transaction Subsystem and Related Methods">Transaction Subsystem and Related Methods</a>,
153 <a class="xref" href="rep.html#replist" title="Replication and Related Methods">Replication and Related Methods</a>
154 </p>
155 </div>
156 </div>
157 <div class="navfooter">
158 <hr />
159 <table width="100%" summary="Navigation footer">
160 <tr>
161 <td width="40%" align="left"><a accesskey="p" href="envtxn_applied.html">Prev</a> </td>
162 <td width="20%" align="center">
163 <a accesskey="u" href="rep.html">Up</a>
164 </td>
165 <td width="40%" align="right"> <a accesskey="n" href="seq.html">Next</a></td>
166 </tr>
167 <tr>
168 <td width="40%" align="left" valign="top">DB_ENV-&gt;txn_applied() </td>
169 <td width="20%" align="center">
170 <a accesskey="h" href="index.html">Home</a>
171 </td>
172 <td width="40%" align="right" valign="top"> Chapter 11. 
173 The DB_SEQUENCE Handle
174 </td>
175 </tr>
176 </table>
177 </div>
178 </body>
179 </html>