File: upgrade_4_2_java.html

package info (click to toggle)
db4.8 4.8.30-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 112,668 kB
  • ctags: 53,848
  • sloc: ansic: 177,324; java: 66,060; tcl: 61,580; cs: 27,778; cpp: 24,761; sh: 15,649; perl: 14,013; xml: 8,309; makefile: 2,303; awk: 1,749; sql: 390; python: 26; php: 22; asm: 14
file content (163 lines) | stat: -rw-r--r-- 8,532 bytes parent folder | download | duplicates (2)
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Release 4.2: Java</title>
    <link rel="stylesheet" href="gettingStarted.css" type="text/css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" />
    <link rel="start" href="index.html" title="Berkeley DB Programmer's Reference Guide" />
    <link rel="up" href="upgrade_4_2_toc.html" title="Chapter 39. Upgrading Berkeley DB 4.1 applications to Berkeley DB 4.2" />
    <link rel="prev" href="upgrade_4_2_toc.html" title="Chapter 39. Upgrading Berkeley DB 4.1 applications to Berkeley DB 4.2" />
    <link rel="next" href="upgrade_4_2_queue.html" title="Release 4.2: Queue access method" />
  </head>
  <body>
    <div class="navheader">
      <table width="100%" summary="Navigation header">
        <tr>
          <th colspan="3" align="center">Release 4.2: Java</th>
        </tr>
        <tr>
          <td width="20%" align="left"><a accesskey="p" href="upgrade_4_2_toc.html">Prev</a> </td>
          <th width="60%" align="center">Chapter 39. Upgrading Berkeley DB 4.1 applications to Berkeley DB 4.2</th>
          <td width="20%" align="right"> <a accesskey="n" href="upgrade_4_2_queue.html">Next</a></td>
        </tr>
      </table>
      <hr />
    </div>
    <div class="sect1" lang="en" xml:lang="en">
      <div class="titlepage">
        <div>
          <div>
            <h2 class="title" style="clear: both"><a id="upgrade_4_2_java"></a>Release 4.2: Java</h2>
          </div>
        </div>
      </div>
      <p>There are a number of major changes to the Java support in Berkeley DB in this
release.  Despite that we have tried to make this a bridge release, a
release where we don't require you to change anything.  We've done this
using the standard approach to deprecation in Java.  If you do not
compile with deprecation warnings on, your existing sources should work
with this new release with only minor changes despite the large number
of changes.  Expect that in a future release we will remove all the
deprecated API and only support the new API names.</p>
      <p>This is a list of areas where we have broken compatibility with the
4.1 release.  In most cases it is a name change in an interface class.
</p>
      <div class="itemizedlist">
        <ul type="disc">
          <li>
            <span class="bold">
              <strong>DbAppDispatch.app_dispatch(DbEnv,Dbt,DbLsn,int)</strong>
            </span>
            <p>is now:
<span class="bold"><strong>DbAppDispatch.appDispatch(DbEnv,Dbt,DbLsn,int)</strong></span></p>
          </li>
          <li>
            <span class="bold">
              <strong>DbAppendRecno.db_append_recno(Db,Dbt,int)</strong>
            </span>
            <p>is now:
<span class="bold"><strong>DbAppendRecno.dbAppendRecno(Db,Dbt,int)</strong></span></p>
          </li>
          <li>
            <span class="bold">
              <strong>DbBtreeCompare.bt_compare(Db,Dbt,Dbt)</strong>
            </span>
            <p>is now:
<span class="bold"><strong>DbBtreeCompare.compare(Db,Dbt,Dbt)</strong></span></p>
          </li>
          <li>
            <span class="bold">
              <strong>DbBtreeCompare.dup_compare(Db,Dbt,Dbt)</strong>
            </span>
            <p>is now:
<span class="bold"><strong>DbBtreeCompare.compareDuplicates(Db,Dbt,Dbt)</strong></span></p>
          </li>
          <li>
            <span class="bold">
              <strong>DbBtreePrefix.bt_prefix(Db,Dbt,Dbt)</strong>
            </span>
            <p>is now:
<span class="bold"><strong>DbBtreePrefix.prefix(Db,Dbt,Dbt)</strong></span></p>
          </li>
          <li>
            <span class="bold">
              <strong>DbSecondaryKeyCreate.secondary_key_create(Db,Dbt,Dbt,Dbt)</strong>
            </span>
            <p>is now:
<span class="bold"><strong>DbSecondaryKeyCreate.secondaryKeyCreate(Db,Dbt,Dbt,Dbt)</strong></span></p>
          </li>
        </ul>
      </div>
      <p>The 4.2 release of Berkeley DB requires at minimum a J2SE 1.3.1 certified Java
virtual machine and associated classes to properly build and execute.
To determine what version virtual machine you are running, enter:</p>
      <pre class="programlisting">java -version</pre>
      <p>at a command line and look for the version number.  If you need to
deploy to a version 1.1 or 1.0 Java environment, it may be possible to
do so by not including the classes in the com.sleepycat.bdb package
in the Java build process (however, that workaround has not been tested
by us).</p>
      <p>A few inconsistent methods have been cleaned up (for example, Db.close
now returns void; previously, it returned an int which was always zero).
The synchronized attributed has been toggled on some methods -- this is
an attempt to prevent multithreaded applications from calling close or
similar methods concurrently from multiple threads.</p>
      <p>The Berkeley DB API has up until now been consistent across all language APIs.
Although consistency has is benefits, it made our Java API look strange to
Java programmers.  Many methods have been renamed in this release of the
Java API to conform with Java naming conventions.  Sometimes this renaming
was simply "camel casing", sometimes it required rewording.  The mapping
file for these name changes is in <code class="filename">dist/camel.pm</code>.  The Perl script
we use to convert code to the new names is called
<code class="filename">dist/camelize.pl</code>, and may help with updating Java applications
written for earlier versions of Berkeley DB.</p>
      <p>Berkeley DB has a number of places where as a C library it uses function pointers
to move into custom code for the purpose of notification of some event.  In
Java the best parallel is the registration of some class which implements
an interface.  In this version of Berkeley DB we have made an effort to make those
interfaces more uniform and predictable.  Specifically, DbEnvFeedback is now
DbEnvFeedbackHandler, DbErrcall is DbErrorHandler and DbFeedback is
DbFeedbackHandler.  In every case we have kept the older interfaces and the
older registration methods so as to allow for backward compatibility in this
release.  Expect them to be removed in future releases.</p>
      <p>As you upgrade to this release of Berkeley DB you will notice that we have
added an entirely new layer inside the package com.sleepycat.bdb.  This
was formerly the Greybird project by Mark Hayes.  Sleepycat Software and
Mark worked together to incorporate his work.  We have done this in
hopes of reducing the learning curve when using Berkeley DB in a Java project.
When you upgrade you should consider switching to this layer as over
time the historical classes and the new bdb package classes will be more
and more integrated providing a simple yet powerful interface from Java
into the Berkeley DB library.</p>
      <p>Berkeley DB's Java API is now generated with <a class="ulink" href="http://www.swig.org" target="_top">SWIG</a>.
The new Java API is significantly faster for many operations.</p>
      <p>Some internal methods and constructors that were previously public have
been hidden or removed.</p>
      <p>Packages found under com.sleepycat are considered different APIs into
the Berkeley DB system.  These include the core db api (com.sleepycat.db), the
collections style access layer (com.sleepycat.bdb) and the now relocated XA
system (com.sleepycat.xa).</p>
    </div>
    <div class="navfooter">
      <hr />
      <table width="100%" summary="Navigation footer">
        <tr>
          <td width="40%" align="left"><a accesskey="p" href="upgrade_4_2_toc.html">Prev</a> </td>
          <td width="20%" align="center">
            <a accesskey="u" href="upgrade_4_2_toc.html">Up</a>
          </td>
          <td width="40%" align="right"> <a accesskey="n" href="upgrade_4_2_queue.html">Next</a></td>
        </tr>
        <tr>
          <td width="40%" align="left" valign="top">Chapter 39. Upgrading Berkeley DB 4.1 applications to Berkeley DB 4.2 </td>
          <td width="20%" align="center">
            <a accesskey="h" href="index.html">Home</a>
          </td>
          <td width="40%" align="right" valign="top"> Release 4.2: Queue access method</td>
        </tr>
      </table>
    </div>
  </body>
</html>