#7 BTree java.io.OptionalDataException

open
Alex Boisvert
None
5
2001-11-13
2001-11-08
Nathan Clement
No

I have set up a test for JDBM which simulates its
intended use in our messaging system. This usage
involves storing messages while they are being
processed, updating them a few times, then removing
them from the storage area.

I have 2 BTrees set up - one which stores the message
itself (updated fairly infrequently) and one which
stores the message statuses (updated more frequently).

The test runs quite well for 200 or so messages, then
I start getting exceptions when using the BTree
object. They occur on either insert or remove
operations.

I am running Sun JDK 1.3.1 on Windows 2000.

java.io.OptionalDataException
at java.io.ObjectInputStream.readObject
(ObjectInputStream.java:411)
at java.io.ObjectInputStream.readObject
(ObjectInputStream.java:236)
at jdbm.btree.BPage.readExternal
(BPage.java:723)
at java.io.ObjectInputStream.inputObject
(ObjectInputStream.java:1212)
at java.io.ObjectInputStream.readObject
(ObjectInputStream.java:386)
at java.io.ObjectInputStream.readObject
(ObjectInputStream.java:236)
at jdbm.recman.RecordManager.byteArrayToObject
(RecordManager.java:294)
at jdbm.recman.RecordManager.fetchObject
(RecordManager.java:236)
at jdbm.helper.ObjectCache.fetchObject
(ObjectCache.java:104)
at jdbm.btree.BTree.getRoot(BTree.java:452)
at jdbm.btree.BTree.remove(BTree.java:308)

java.io.OptionalDataException
at java.io.ObjectInputStream.readObject
(ObjectInputStream.java:411)
at java.io.ObjectInputStream.readObject
(ObjectInputStream.java:236)
at jdbm.btree.BPage.readExternal
(BPage.java:723)
at java.io.ObjectInputStream.inputObject
(ObjectInputStream.java:1212)
at java.io.ObjectInputStream.readObject
(ObjectInputStream.java:386)
at java.io.ObjectInputStream.readObject
(ObjectInputStream.java:236)
at jdbm.recman.RecordManager.byteArrayToObject
(RecordManager.java:294)
at jdbm.recman.RecordManager.fetchObject
(RecordManager.java:236)
at jdbm.helper.ObjectCache.fetchObject
(ObjectCache.java:104)
at jdbm.btree.BTree.getRoot(BTree.java:452)
at jdbm.btree.BTree.insert(BTree.java:256)

Discussion

  • Alex Boisvert
    Alex Boisvert
    2001-11-13

    • assigned_to: nobody --> boisvert
     
  • Alex Boisvert
    Alex Boisvert
    2001-11-14

    Synthetic test case

     
    Attachments
  • Alex Boisvert
    Alex Boisvert
    2001-11-14

    Logged In: YES
    user_id=982

    I have been unable to reproduce this bug so far. I've
    written a test case which simulates the insertion and
    removal of messages in one BTree and the insertion, update
    and removal of message status in another BTree.

    See attached example.

     
  • Nathan Clement
    Nathan Clement
    2001-11-15

    Logged In: YES
    user_id=310643

    I have tried to write a test case that reproduces the
    problem, but have not been successful. I have attached a
    file which simulates more accurately the test that I set
    up. The actual application uses mulitple threads to
    process the message, but the test program uses only a
    single thread. I set up the messaging application in a
    loop-back mode, with a single message travelling around
    repeatedly. The steps in the example program show the
    relevant steps in our application. Note that I was using
    the record manager with transactions disabled, if that
    makes any difference.

    I'm sorry that I can't provide any more information - I
    can't really send the source code to our whole messaging
    application, and I can't seem to reproduce the problem
    outside that environment. Because of the workaround I
    spoke about earlier, I wouldn't complain if we just dropped
    the issue.

     
  • Nathan Clement
    Nathan Clement
    2001-11-15

    Updated test case (still does not reproduce error)

     
    Attachments