Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not work with JodaTime #98

Open
michail-prusakov opened this issue Oct 17, 2012 · 0 comments
Open

Does not work with JodaTime #98

michail-prusakov opened this issue Oct 17, 2012 · 0 comments

Comments

@michail-prusakov
Copy link

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;
}

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant