~ubuntu-branches/ubuntu/edgy/rpm/edgy

« back to all changes in this revision

Viewing changes to db/docs/ref/upgrade.3.0/func.html

  • Committer: Bazaar Package Importer
  • Author(s): Joey Hess
  • Date: 2002-01-22 20:56:57 UTC
  • Revision ID: james.westby@ubuntu.com-20020122205657-l74j50mr9z8ofcl5
Tags: upstream-4.0.3
ImportĀ upstreamĀ versionĀ 4.0.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!--$Id: func.so,v 11.9 2001/03/01 15:58:20 bostic Exp $-->
 
2
<!--Copyright 1997-2001 by Sleepycat Software, Inc.-->
 
3
<!--All rights reserved.-->
 
4
<html>
 
5
<head>
 
6
<title>Berkeley DB Reference Guide: Release 3.0: function arguments</title>
 
7
<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit.">
 
8
<meta name="keywords" content="embedded,database,programmatic,toolkit,b+tree,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,java,C,C++">
 
9
</head>
 
10
<body bgcolor=white>
 
11
<table width="100%"><tr valign=top>
 
12
<td><h3><dl><dt>Berkeley DB Reference Guide:<dd>Upgrading Berkeley DB Applications</dl></h3></td>
 
13
<td align=right><a href="../../ref/upgrade.3.0/envopen.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/dbenv.html"><img src="../../images/next.gif" alt="Next"></a>
 
14
</td></tr></table>
 
15
<p>
 
16
<h1 align=center>Release 3.0: function arguments</h1>
 
17
<p>In Berkeley DB 3.0, there are no longer separate structures that represent
 
18
each subsystem (for example, DB_LOCKTAB or DB_TXNMGR), and an overall
 
19
DB_ENV environment structure.  Instead there is only the
 
20
DB_ENV structure.  This means that DB_ENV references
 
21
should be passed around by your application instead of passing around
 
22
DB_LOCKTAB or DB_TXNMGR references.
 
23
<p>Each of the following functions:
 
24
<p><blockquote><pre>lock_detect
 
25
lock_get
 
26
lock_id
 
27
lock_put
 
28
lock_stat
 
29
lock_vec</pre></blockquote>
 
30
<p>should have its first argument, a reference to the DB_LOCKTAB structure,
 
31
replaced with a reference to the enclosing DB_ENV structure.  For
 
32
example, the following line of code from a Berkeley DB 2.X application:
 
33
<p><blockquote><pre>DB_LOCKTAB *lt;
 
34
DB_LOCK lock;
 
35
        ret = lock_put(lt, lock);</pre></blockquote>
 
36
<p>should now be written as follows:
 
37
<p><blockquote><pre>DB_ENV *dbenv;
 
38
DB_LOCK *lock;
 
39
        ret = lock_put(dbenv, lock);</pre></blockquote>
 
40
<p>Similarly, all of the functions:
 
41
<p><blockquote><pre>log_archive
 
42
log_compare
 
43
log_file
 
44
log_flush
 
45
log_get
 
46
log_put
 
47
log_register
 
48
log_stat
 
49
log_unregister</pre></blockquote>
 
50
<p>should have their DB_LOG argument replaced with a reference to a
 
51
DB_ENV structure, and the functions:
 
52
<p><blockquote><pre>memp_fopen
 
53
memp_register
 
54
memp_stat
 
55
memp_sync
 
56
memp_trickle</pre></blockquote>
 
57
<p>should have their DB_MPOOL argument replaced with a reference to a
 
58
DB_ENV structure.
 
59
<p>You should remove all references to DB_LOCKTAB, DB_LOG, DB_MPOOL, and
 
60
DB_TXNMGR structures from your application, they are no longer useful
 
61
in any way.  In fact, a simple way to identify all of the places that
 
62
need to be upgraded is to remove all such structures and variables
 
63
they declare, and then compile.  You will see a warning message from
 
64
your compiler in each case that needs to be upgraded.
 
65
<table width="100%"><tr><td><br></td><td align=right><a href="../../ref/upgrade.3.0/envopen.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/dbenv.html"><img src="../../images/next.gif" alt="Next"></a>
 
66
</td></tr></table>
 
67
<p><font size=1><a href="http://www.sleepycat.com">Copyright Sleepycat Software</a></font>
 
68
</body>
 
69
</html>