~ubuntu-branches/ubuntu/maverick/evolution-data-server/maverick-proposed

« back to all changes in this revision

Viewing changes to libdb/docs/ref/upgrade.2.0/convert.html

  • Committer: Bazaar Package Importer
  • Author(s): Didier Roche
  • Date: 2010-05-17 17:02:06 UTC
  • mfrom: (1.1.79 upstream) (1.6.12 experimental)
  • Revision ID: james.westby@ubuntu.com-20100517170206-4ufr52vwrhh26yh0
Tags: 2.30.1-1ubuntu1
* Merge from debian experimental. Remaining change:
  (LP: #42199, #229669, #173703, #360344, #508494)
  + debian/control:
    - add Vcs-Bzr tag
    - don't use libgnome
    - Use Breaks instead of Conflicts against evolution 2.25 and earlier.
  + debian/evolution-data-server.install,
    debian/patches/45_libcamel_providers_version.patch:
    - use the upstream versioning, not a Debian-specific one 
  + debian/libedata-book1.2-dev.install, debian/libebackend-1.2-dev.install,
    debian/libcamel1.2-dev.install, debian/libedataserverui1.2-dev.install:
    - install html documentation
  + debian/rules:
    - don't build documentation it's shipped with the tarball

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<!--$Id$-->
2
 
<!--Copyright 1997-2002 by Sleepycat Software, Inc.-->
3
 
<!--All rights reserved.-->
4
 
<!--See the file LICENSE for redistribution information.-->
5
 
<html>
6
 
<head>
7
 
<title>Berkeley DB Reference Guide: Release 2.0: converting applications</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++">
10
 
</head>
11
 
<body bgcolor=white>
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.2.0/system.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.2.0/disk.html"><img src="../../images/next.gif" alt="Next"></a>
15
 
</td></tr></table>
16
 
<p>
17
 
<h1 align=center>Release 2.0: converting applications</h1>
18
 
<p>Mapping the Berkeley DB 1.85 functionality into Berkeley DB version 2 is almost always
19
 
simple.  The manual page <a href="../../api_c/db_open.html">DB-&gt;open</a> replaces the Berkeley DB 1.85 manual
20
 
pages <b>dbopen</b>(3), <b>btree</b>(3), <b>hash</b>(3) and
21
 
<b>recno</b>(3).  You should be able to convert each 1.85 function
22
 
call into a Berkeley DB version 2 function call using just the <a href="../../api_c/db_open.html">DB-&gt;open</a>
23
 
documentation.
24
 
<p>Some guidelines and things to watch out for:
25
 
<p><ol>
26
 
<p><li>Most access method functions have exactly the same semantics as in Berkeley DB
27
 
1.85, although the arguments to the functions have changed in some cases.
28
 
To get your code to compile, the most common change is to add the
29
 
transaction ID as an argument (NULL, since Berkeley DB 1.85 did not support
30
 
transactions.)
31
 
<p><li>You must always initialize DBT structures to zero before using them with
32
 
any Berkeley DB version 2 function.  (They do not normally have to be
33
 
reinitialized each time, only when they are first allocated.  Do this by
34
 
declaring the DBT structure external or static, or by calling the C
35
 
library routine <b>bzero</b>(3) or <b>memset</b>(3).)
36
 
<p><li>The error returns are completely different in the two versions.  In Berkeley DB
37
 
1.85, &lt; 0 meant an error, and &gt; 0 meant a minor Berkeley DB exception.
38
 
In Berkeley DB 2.0, &gt; 0 means an error (the Berkeley DB version 2 functions
39
 
return <b>errno</b> on error) and &lt; 0 means a Berkeley DB exception.
40
 
See <a href="../../ref/program/errorret.html">Error Returns to Applications</a>
41
 
for more information.
42
 
<p><li>The Berkeley DB 1.85 DB-&gt;seq function has been replaced by cursors in Berkeley DB
43
 
version 2.  The semantics are approximately the same, but cursors require
44
 
the creation of an extra object (the DBC object), which is then used to
45
 
access the database.
46
 
<p>Specifically, the partial key match and range search functionality of the
47
 
R_CURSOR flag in DB-&gt;seq has been replaced by the
48
 
<a href="../../api_c/dbc_get.html#DB_SET_RANGE">DB_SET_RANGE</a> flag in <a href="../../api_c/dbc_get.html">DBcursor-&gt;c_get</a>.
49
 
<p><li>In version 2 of the Berkeley DB library, additions or deletions into Recno
50
 
(fixed and variable-length record) databases no longer automatically
51
 
logically renumber all records after the add/delete point, by default.
52
 
The default behavior is that deleting records does not cause subsequent
53
 
records to be renumbered, and it is an error to attempt to add new records
54
 
between records already in the database.  Applications wanting the
55
 
historic Recno access method semantics should call the
56
 
<a href="../../api_c/db_set_flags.html">DB-&gt;set_flags</a> method with the <a href="../../api_c/db_set_flags.html#DB_RENUMBER">DB_RENUMBER</a> flag.
57
 
<p><li>Opening a database in Berkeley DB version 2 is a much heavier-weight operation
58
 
than it was in Berkeley DB 1.85.  Therefore, if your historic applications were
59
 
written to open a database, perform a single operation, and close the
60
 
database, you may observe performance degradation.  In most cases, this
61
 
is due to the expense of creating the environment upon each open.   While
62
 
we encourage restructuring your application to avoid repeated opens and
63
 
closes, you can probably recover most of the lost performance by simply
64
 
using a persistent environment across invocations.
65
 
</ol>
66
 
<p>While simply converting Berkeley DB 1.85 function calls to Berkeley DB version 2
67
 
function calls will work, we recommend that you eventually reconsider your
68
 
application's interface to the Berkeley DB database library in light of the
69
 
additional functionality supplied by Berkeley DB version 2, as it is likely to
70
 
result in enhanced application performance.
71
 
<table width="100%"><tr><td><br></td><td align=right><a href="../../ref/upgrade.2.0/system.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.2.0/disk.html"><img src="../../images/next.gif" alt="Next"></a>
72
 
</td></tr></table>
73
 
<p><font size=1><a href="http://www.sleepycat.com">Copyright Sleepycat Software</a></font>
74
 
</body>
75
 
</html>