Home Bug Reports

DB 4.0.14 and IceJ problems

christophchristoph Member COrganization: AProject: none
Hello,

I found some problems running the tests in IceJ's Freeze directory.
While the C++ tests worked perfectly all the java tests failed.
It seems that Berkeley DB's java wrapper is the reason for the problems.
Unfortunately, I could not find any information about it on Sleepycats website.

Btw, I'm using db 4.0.14-64 on Linux (SuSE 8.0).

Here are some more details about the failed tests:

* cursor
line 118 in Client.java: the call to cursor.next() always returns "true"

* complex and dbmap
the problem is visible in Freeze.Map.put():
try {
byte[] v = _db.get(k);
o = decodeValue(v, _communicator);
} catch(DBNotFoundException e) ...

_db.get() does not raise a DBNotFoundException if key was not found but returns "null".
So the next call to decodeValue() results in a NullPointerException.

* evictor
The same thing happens in Freeze.Map.get()

An update to db 4.1.25 does not work either. The reason for that might be an API change
(db.open) as indicated in the documentation.

Christoph

Comments

  • mesmes CaliforniaAdministrators, ZeroC Staff Mark SpruiellOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    Hi Christoph,

    I've been using db 4.1.24NC for quite a while with no problems. We've also tested with db 3.3.11. Today I downloaded and tested both 4.1.25 and 4.1.25NC - no problems with either of them on my machine (RH7.1). I also hope to try this on a SuSE installation soon.

    Are you absolutely sure you had the proper environment settings, i.e., that CLASSPATH and LD_LIBRARY_PATH were set properly to select version 4.1.25?

    - Mark
  • christophchristoph Member COrganization: AProject: none
    Hello,

    the tests failed when I used the precompiled Ice.jar.
    After creating the jar myself all the problems with db 4.0.14 were gone.

    Comparing both jars showed that there are two files (Freeze/DBI.class and Freeze/DBCursorI.class) that differ.
    Running diff on the decompiled java code unveiled that some return codes
    have changed. That explains all the problems I encountered.

    Maybe the same happend with db 4.1.25. But you might also be right that I
    made a mistakes setting the environment.
    I will test it again and tell you about the results.

    Christoph
  • christophchristoph Member COrganization: AProject: none
    Hello,

    I just fixed the problem mit db-4.1.25

    dbEnv->open() in src/Freeze/DBI.cpp line 166 always returned 22 (EINVAL).

    This was due to the configure option "--enable-posixmutexes".
    After configuring Berkeley DB with
    --enable-cxx --enable-java -enable-rpc --enable-tcl --with-tcl=/usr/lib/ --enable-test
    everything works as expected.

    An remark to the previous posting:
    I compared the header files (db.h) from db 4.0.14 and 4.1.25 and found that ~25 error codes have changed.
    To avoid similiar problems it might be a good idea to encourage everyone to compile Ice.jar for their platform.

    Christoph
  • mesmes CaliforniaAdministrators, ZeroC Staff Mark SpruiellOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    Christoph,

    Thanks for following up on this. I've added the following paragraph to the IceJ INSTALL file for the next release:
    Note that the Ice for Java distribution is compiled against Berkeley
    DB 4.1.25. If you are using an older version of Berkeley DB, you
    may encounter problems using Freeze. In this case, either upgrade
    your version of Berkeley DB, or recompile the Ice for Java sources
    against your existing version (see "Compiling the Source" below).
    
    Sound OK?

    - Mark
  • christophchristoph Member COrganization: AProject: none
    Hello Mark,

    Yes, this would be fine.

    Christoph
Sign In or Register to comment.