2
<!--Copyright 1997-2002 by Sleepycat Software, Inc.-->
3
<!--All rights reserved.-->
4
<!--See the file LICENSE for redistribution information.-->
7
<title>Berkeley DB Reference Guide: Release 3.0: the DBINFO structure</title>
8
<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit.">
9
<meta name="keywords" content="embedded,database,programmatic,toolkit,b+tree,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,java,C,C++">
12
<table width="100%"><tr valign=top>
13
<td><h3><dl><dt>Berkeley DB Reference Guide:<dd>Upgrading Berkeley DB Applications</dl></h3></td>
14
<td align=right><a href="../../ref/upgrade.3.0/db.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../../reftoc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../../ref/upgrade.3.0/join.html"><img src="../../images/next.gif" alt="Next"></a>
17
<h1 align=center>Release 3.0: the DBINFO structure</h1>
18
<p>The DB_INFO structure has been removed from the Berkeley DB 3.0 release.
19
Accesses to any fields within that structure by the application should be
20
replaced with method calls on the <a href="../../api_c/db_class.html">DB</a> handle. The following
21
example illustrates this using the historic db_cachesize structure field.
22
In the Berkeley DB 2.X releases, applications could set the size of an
23
underlying database cache using code similar to the following:
24
<p><blockquote><pre>DB_INFO dbinfo;
26
memset(dbinfo, 0, sizeof(dbinfo));
27
dbinfo.db_cachesize = 1024 * 1024;</pre></blockquote>
28
<p>in the Berkeley DB 3.X releases, this should be done using the
29
<a href="../../api_c/db_set_cachesize.html">DB->set_cachesize</a> method, as follows:
30
<p><blockquote><pre>DB *db;
33
ret = db->set_cachesize(db, 0, 1024 * 1024, 0);</pre></blockquote>
34
<p>The DB_INFO structure is no longer used in any way by the Berkeley DB 3.0
35
release, and should be removed from the application.
36
<p>The following table lists the DB_INFO fields previously used by
37
applications and the methods that should now be used to set
38
them. Because these calls provide configuration for the
39
database open, they must precede the call to <a href="../../api_c/db_open.html">DB->open</a>.
40
Calling them after the call to <a href="../../api_c/db_open.html">DB->open</a> will return an
42
<p><table border=1 align=center>
43
<tr><th>DB_INFO field</th><th>Berkeley DB 3.X method</th></tr>
44
<tr><td>bt_compare</td><td><a href="../../api_c/db_set_bt_compare.html">DB->set_bt_compare</a></td></tr>
45
<tr><td>bt_minkey</td><td><a href="../../api_c/db_set_bt_minkey.html">DB->set_bt_minkey</a></td></tr>
46
<tr><td>bt_prefix</td><td><a href="../../api_c/db_set_bt_prefix.html">DB->set_bt_prefix</a></td></tr>
47
<tr><td>db_cachesize</td><td><a href="../../api_c/db_set_cachesize.html">DB->set_cachesize</a>
48
<p>Note: the <a href="../../api_c/db_set_cachesize.html">DB->set_cachesize</a> function takes additional arguments.
49
Setting both the second argument (the number of GB in the pool) and the
50
last argument (the number of memory pools to create) to 0 will result in
51
behavior that is backward-compatible with previous Berkeley DB releases.</td></tr>
52
<tr><td>db_lorder</td><td><a href="../../api_c/db_set_lorder.html">DB->set_lorder</a></td></tr>
53
<tr><td>db_malloc</td><td>DB->set_malloc</td></tr>
54
<tr><td>db_pagesize</td><td><a href="../../api_c/db_set_pagesize.html">DB->set_pagesize</a></td></tr>
55
<tr><td>dup_compare</td><td><a href="../../api_c/db_set_dup_compare.html">DB->set_dup_compare</a></td></tr>
56
<tr><td>flags</td><td><a href="../../api_c/db_set_flags.html">DB->set_flags</a>
57
<p>Note: the DB_DELIMITER, DB_FIXEDLEN and DB_PAD flags no longer need to be
58
set as there are specific methods off the <a href="../../api_c/db_class.html">DB</a> handle that set the
59
file delimiter, the length of fixed-length records and the fixed-length
60
record pad character. They should simply be discarded from the application.</td></tr>
61
<tr><td>h_ffactor</td><td><a href="../../api_c/db_set_h_ffactor.html">DB->set_h_ffactor</a></td></tr>
62
<tr><td>h_hash</td><td><a href="../../api_c/db_set_h_hash.html">DB->set_h_hash</a></td></tr>
63
<tr><td>h_nelem</td><td><a href="../../api_c/db_set_h_nelem.html">DB->set_h_nelem</a></td></tr>
64
<tr><td>re_delim</td><td><a href="../../api_c/db_set_re_delim.html">DB->set_re_delim</a></td></tr>
65
<tr><td>re_len</td><td><a href="../../api_c/db_set_re_len.html">DB->set_re_len</a></td></tr>
66
<tr><td>re_pad</td><td><a href="../../api_c/db_set_re_pad.html">DB->set_re_pad</a></td></tr>
67
<tr><td>re_source</td><td><a href="../../api_c/db_set_re_source.html">DB->set_re_source</a></td></tr>
69
<table width="100%"><tr><td><br></td><td align=right><a href="../../ref/upgrade.3.0/db.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../../reftoc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../../ref/upgrade.3.0/join.html"><img src="../../images/next.gif" alt="Next"></a>
71
<p><font size=1><a href="http://www.sleepycat.com">Copyright Sleepycat Software</a></font>