JDBM3 icon indicating copy to clipboard operation
JDBM3 copied to clipboard

Does not work with JodaTime

Open michail-prusakov opened this issue 13 years ago • 0 comments

Consider the unit test below. The test fails with NotSerializableException. However if i switch to java serialiazation mechanism everything works as expected.

import java.util.List;

import org.apache.jdbm.DB; import org.apache.jdbm.DBMaker; import org.joda.time.DateTime; import org.junit.Test;

public class JDBMTester {

@Test
public void testJodaTime() {
    DB db = DBMaker.openFile("tmp1").make();
    List<DateTime> list = getList(db, "list1");
    list.add(new DateTime());
    db.commit();
    db.close();
}

private <K> List<K> getList(DB db, String name) {
    List<K> result = db.getLinkedList(name);
    if (result == null) {
        result = db.createLinkedList(name);
    }
    return result;
}

}

michail-prusakov avatar Oct 17 '12 19:10 michail-prusakov