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