Debian Codegraph @

docs/upgrading/upgrade_3_0_dbenv.html

raw
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 structure</title>
7 <link rel="stylesheet" href="gettingStarted.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 Upgrade Guide" />
10 <link rel="up" href="upgrade_3_0_toc.html" title="Chapter 14. Upgrading Berkeley DB 2.X applications to Berkeley DB 3.0" />
11 <link rel="prev" href="upgrade_3_0_func.html" title="function arguments" />
12 <link rel="next" href="upgrade_3_0_open.html" title="database open/close" />
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_ENV structure</th>
22 </tr>
23 <tr>
24 <td width="20%" align="left"><a accesskey="p" href="upgrade_3_0_func.html">Prev</a> </td>
25 <th width="60%" align="center">Chapter 14. Upgrading Berkeley DB 2.X applications to Berkeley DB 3.0</th>
26 <td width="20%" align="right"> <a accesskey="n" href="upgrade_3_0_open.html">Next</a></td>
27 </tr>
28 </table>
29 <hr />
30 </div>
31 <div class="sect1" lang="en" xml:lang="en">
32 <div class="titlepage">
33 <div>
34 <div>
35 <h2 class="title" style="clear: both"><a id="upgrade_3_0_dbenv"></a>DB_ENV structure</h2>
36 </div>
37 </div>
38 </div>
39 <p>The <a href="../api_reference/C/env.html" class="olink">DB_ENV</a> structure is now opaque for applications in the Berkeley DB
40 3.0 release. Accesses to any fields within that structure by the
41 application should be replaced with method calls. The following example
42 illustrates this using the historic errpfx structure field. In the Berkeley DB
43 2.X releases, applications set error prefixes using code similar to the
44 following:</p>
45 <pre class="programlisting">DB_ENV *dbenv;
46
47 dbenv-&gt;errpfx = "my prefix";</pre>
48 <p>in the Berkeley DB 3.X releases, this should be done using the
49 <a href="../api_reference/C/envset_errpfx.html" class="olink">DB_ENV-&gt;set_errpfx()</a> method, as follows:</p>
50 <pre class="programlisting">DB_ENV *dbenv;
51
52 dbenv-&gt;set_errpfx(dbenv, "my prefix");</pre>
53 <p>The following table lists the <a href="../api_reference/C/env.html" class="olink">DB_ENV</a> fields previously used by
54 applications and the methods that should now be used to set them.</p>
55 <div class="informaltable">
56 <table border="1" width="80%">
57 <colgroup>
58 <col />
59 <col />
60 </colgroup>
61 <thead>
62 <tr>
63 <th><a href="../api_reference/C/env.html" class="olink">DB_ENV</a> field</th>
64 <th>Berkeley DB 3.X method</th>
65 </tr>
66 </thead>
67 <tbody>
68 <tr>
69 <td>db_errcall</td>
70 <td>
71 <a href="../api_reference/C/envset_errcall.html" class="olink">DB_ENV-&gt;set_errcall()</a>
72 </td>
73 </tr>
74 <tr>
75 <td>db_errfile</td>
76 <td>
77 <a href="../api_reference/C/envset_errfile.html" class="olink">DB_ENV-&gt;set_errfile()</a>
78 </td>
79 </tr>
80 <tr>
81 <td>db_errpfx</td>
82 <td>
83 <a href="../api_reference/C/envset_errpfx.html" class="olink">DB_ENV-&gt;set_errpfx()</a>
84 </td>
85 </tr>
86 <tr>
87 <td>db_lorder</td>
88 <td>This field was removed from the <a href="../api_reference/C/env.html" class="olink">DB_ENV</a> structure in the Berkeley DB
89 3.0 release as no application should have ever used it. Any code using
90 it should be evaluated for potential bugs.</td>
91 </tr>
92 <tr>
93 <td>db_paniccall</td>
94 <td>DB_ENV-&gt;set_paniccall</td>
95 </tr>
96 <tr>
97 <td>db_verbose</td>
98 <td><a href="../api_reference/C/envset_verbose.html" class="olink">DB_ENV-&gt;set_verbose()</a>
99 <p>Note: the db_verbose field was a simple boolean toggle, the
100 <a href="../api_reference/C/envset_verbose.html" class="olink">DB_ENV-&gt;set_verbose()</a> method takes arguments that specify exactly
101 which verbose messages are desired.</p></td>
102 </tr>
103 <tr>
104 <td>lg_max</td>
105 <td>
106 <a href="../api_reference/C/envset_lg_max.html" class="olink">DB_ENV-&gt;set_lg_max()</a>
107 </td>
108 </tr>
109 <tr>
110 <td>lk_conflicts</td>
111 <td>
112 <a href="../api_reference/C/envset_lk_conflicts.html" class="olink">DB_ENV-&gt;set_lk_conflicts()</a>
113 </td>
114 </tr>
115 <tr>
116 <td>lk_detect</td>
117 <td>
118 <a href="../api_reference/C/envset_lk_detect.html" class="olink">DB_ENV-&gt;set_lk_detect()</a>
119 </td>
120 </tr>
121 <tr>
122 <td>lk_max</td>
123 <td>dbenv-&gt;set_lk_max</td>
124 </tr>
125 <tr>
126 <td>lk_modes</td>
127 <td>
128 <a href="../api_reference/C/envset_lk_conflicts.html" class="olink">DB_ENV-&gt;set_lk_conflicts()</a>
129 </td>
130 </tr>
131 <tr>
132 <td>mp_mmapsize</td>
133 <td>
134 <a href="../api_reference/C/envset_mp_mmapsize.html" class="olink">DB_ENV-&gt;set_mp_mmapsize()</a>
135 </td>
136 </tr>
137 <tr>
138 <td>mp_size</td>
139 <td><a href="../api_reference/C/envset_cachesize.html" class="olink">DB_ENV-&gt;set_cachesize()</a>
140 <p>Note: the <a href="../api_reference/C/envset_cachesize.html" class="olink">DB_ENV-&gt;set_cachesize()</a> function takes additional arguments.
141 Setting both the second argument (the number of GB in the pool) and the
142 last argument (the number of memory pools to create) to 0 will result in
143 behavior that is backward-compatible with previous Berkeley DB releases.</p></td>
144 </tr>
145 <tr>
146 <td>tx_info</td>
147 <td>This field was used by applications as an argument to the transaction
148 subsystem functions. As those functions take references to a
149 <a href="../api_reference/C/env.html" class="olink">DB_ENV</a> structure as arguments in the Berkeley DB 3.0 release, it should
150 no longer be used by any application.</td>
151 </tr>
152 <tr>
153 <td>tx_max</td>
154 <td>
155 <a href="../api_reference/C/envset_tx_max.html" class="olink">DB_ENV-&gt;set_tx_max()</a>
156 </td>
157 </tr>
158 <tr>
159 <td>tx_recover</td>
160 <td>dbenv-&gt;set_tx_recover</td>
161 </tr>
162 </tbody>
163 </table>
164 </div>
165 </div>
166 <div class="navfooter">
167 <hr />
168 <table width="100%" summary="Navigation footer">
169 <tr>
170 <td width="40%" align="left"><a accesskey="p" href="upgrade_3_0_func.html">Prev</a> </td>
171 <td width="20%" align="center">
172 <a accesskey="u" href="upgrade_3_0_toc.html">Up</a>
173 </td>
174 <td width="40%" align="right"> <a accesskey="n" href="upgrade_3_0_open.html">Next</a></td>
175 </tr>
176 <tr>
177 <td width="40%" align="left" valign="top">function arguments </td>
178 <td width="20%" align="center">
179 <a accesskey="h" href="index.html">Home</a>
180 </td>
181 <td width="40%" align="right" valign="top"> database open/close</td>
182 </tr>
183 </table>
184 </div>
185 </body>
186 </html>