Debian Codegraph @

docs/api_reference/CXX/logput.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>DbEnv::log_put()</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="lsn.html" title="Chapter 8.  The DbLsn Handle" />
11 <link rel="prev" href="logprintf.html" title="DbEnv::log_printf()" />
12 <link rel="next" href="envlog_set_config.html" title="DbEnv::log_set_config()" />
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">DbEnv::log_put()</th>
22 </tr>
23 <tr>
24 <td width="20%" align="left"><a accesskey="p" href="logprintf.html">Prev</a> </td>
25 <th width="60%" align="center">Chapter 8. 
26 The DbLsn Handle
27 </th>
28 <td width="20%" align="right"> <a accesskey="n" href="envlog_set_config.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="logput"></a>DbEnv::log_put()</h2>
38 </div>
39 </div>
40 </div>
41 <pre class="programlisting">#include &lt;db_cxx.h&gt;
42
43 int
44 DbEnv::log_put(DbLsn *lsn, const Dbt *data, u_int32_t flags);</pre>
45 <p>
46 The <code class="methodname">DbEnv::log_put()</code> method appends records to the log. The
47 <a class="link" href="lsn.html" title="Chapter 8.  The DbLsn Handle">DbLsn</a> of the put record is
48 returned in the <span class="bold"><strong>lsn</strong></span> parameter.
49 </p>
50 <p>
51 The <code class="methodname">DbEnv::log_put()</code> <span>
52
53 <span>
54 method either returns a non-zero error value or throws an
55 exception that encapsulates a non-zero error value on
56 failure, and returns 0 on success.
57 </span>
58 </span>
59 </p>
60 <div class="sect2" lang="en" xml:lang="en">
61 <div class="titlepage">
62 <div>
63 <div>
64 <h3 class="title"><a id="idp8364888"></a>Parameters</h3>
65 </div>
66 </div>
67 </div>
68 <div class="sect3" lang="en" xml:lang="en">
69 <div class="titlepage">
70 <div>
71 <div>
72 <h4 class="title"><a id="idp8364240"></a>lsn</h4>
73 </div>
74 </div>
75 </div>
76 <p>
77 The <span class="bold"><strong>lsn</strong></span> parameter references memory
78 into which the <a class="link" href="lsn.html" title="Chapter 8.  The DbLsn Handle">DbLsn</a> of
79 the put record is copied.
80 </p>
81 </div>
82 <div class="sect3" lang="en" xml:lang="en">
83 <div class="titlepage">
84 <div>
85 <div>
86 <h4 class="title"><a id="idp8339448"></a>data</h4>
87 </div>
88 </div>
89 </div>
90 <p>
91 The <span class="bold"><strong>data</strong></span> parameter is the record to
92 write to the log.
93 </p>
94 <p>
95 The caller is responsible for providing any necessary structure to
96 <span class="bold"><strong>data</strong></span>. (For example, in a write-ahead
97 logging protocol, the application must understand what part of
98 <span class="bold"><strong>data</strong></span> is an operation code, what part
99 is redo information, and what part is undo information. In addition,
100 most transaction managers will store in <span class="bold"><strong>data</strong></span> the
101 <a class="link" href="lsn.html" title="Chapter 8.  The DbLsn Handle">DbLsn</a> of the previous log
102 record for the same transaction, to support chaining back through the
103 transaction's log records during undo.)
104 </p>
105 </div>
106 <div class="sect3" lang="en" xml:lang="en">
107 <div class="titlepage">
108 <div>
109 <div>
110 <h4 class="title"><a id="idp8337936"></a>flags</h4>
111 </div>
112 </div>
113 </div>
114 <p>
115 The <span class="bold"><strong>flags</strong></span> parameter must be set to 0
116 or the following value:
117 </p>
118 <div class="itemizedlist">
119 <ul type="disc">
120 <li>
121 <p><a id="put_DB_FLUSH"></a>
122 <code class="literal">DB_FLUSH</code>
123 </p>
124 <p>
125 The log is forced to disk after this record is written, guaranteeing
126 that all records with <a class="link" href="lsn.html" title="Chapter 8.  The DbLsn Handle">DbLsn</a>
127 values less than or equal to the one being "put" are on disk
128 before <code class="methodname">DbEnv::log_put()</code> returns.
129 </p>
130 </li>
131 </ul>
132 </div>
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="idp8372096"></a>Errors</h3>
140 </div>
141 </div>
142 </div>
143 <p>
144 The <code class="methodname">DbEnv::log_put()</code> <span>
145
146 <span>
147 method may fail and throw a <a class="link" href="dbexception.html" title="Chapter 6. The DbException Class">DbException</a>
148 exception, encapsulating one of the following non-zero errors, or return one
149 of the following non-zero errors:
150 </span>
151 </span>
152 </p>
153 <div class="sect3" lang="en" xml:lang="en">
154 <div class="titlepage">
155 <div>
156 <div>
157 <h4 class="title"><a id="idp8382352"></a>EINVAL</h4>
158 </div>
159 </div>
160 </div>
161 <p>
162 If the record to be logged is larger than the maximum log record; or
163 if an invalid flag value or parameter was specified.
164 </p>
165 </div>
166 </div>
167 <div class="sect2" lang="en" xml:lang="en">
168 <div class="titlepage">
169 <div>
170 <div>
171 <h3 class="title"><a id="idp8381272"></a>Class</h3>
172 </div>
173 </div>
174 </div>
175 <p>
176 <a class="link" href="env.html" title="Chapter 5.  The DbEnv Handle">DbEnv</a>,
177 <a class="link" href="logc.html" title="The DbLogc Handle">DbLogc</a>,
178 <a class="link" href="lsn.html" title="Chapter 8.  The DbLsn Handle">DbLsn</a>
179 </p>
180 </div>
181 <div class="sect2" lang="en" xml:lang="en">
182 <div class="titlepage">
183 <div>
184 <div>
185 <h3 class="title"><a id="idp8383648"></a>See Also</h3>
186 </div>
187 </div>
188 </div>
189 <p>
190 <a class="xref" href="lsn.html#loglist" title="Logging Subsystem and Related Methods">Logging Subsystem and Related Methods</a>
191 </p>
192 </div>
193 </div>
194 <div class="navfooter">
195 <hr />
196 <table width="100%" summary="Navigation footer">
197 <tr>
198 <td width="40%" align="left"><a accesskey="p" href="logprintf.html">Prev</a> </td>
199 <td width="20%" align="center">
200 <a accesskey="u" href="lsn.html">Up</a>
201 </td>
202 <td width="40%" align="right"> <a accesskey="n" href="envlog_set_config.html">Next</a></td>
203 </tr>
204 <tr>
205 <td width="40%" align="left" valign="top">DbEnv::log_printf() </td>
206 <td width="20%" align="center">
207 <a accesskey="h" href="index.html">Home</a>
208 </td>
209 <td width="40%" align="right" valign="top"> DbEnv::log_set_config()</td>
210 </tr>
211 </table>
212 </div>
213 </body>
214 </html>