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

AssertionError in getAtomicVar #513

Closed
jrumbinas opened this issue May 20, 2015 · 1 comment
Closed

AssertionError in getAtomicVar #513

jrumbinas opened this issue May 20, 2015 · 1 comment
Labels

Comments

@jrumbinas
Copy link

Calling DB.getAtomicVar() for non existing record will result in exception error (in 1.0.7)

Exception

java.lang.AssertionError
    at org.mapdb.StoreWAL.put(StoreWAL.java:199)
    at org.mapdb.Caches$HashTable.put(Caches.java:216)
    at org.mapdb.EngineWrapper.put(EngineWrapper.java:53)
    at org.mapdb.DB.createAtomicVar(DB.java:1393)
    at org.mapdb.DB.getAtomicVar(DB.java:1418)

Cause

    synchronized public <E> Atomic.Var<E> getAtomicVar(String name){
        ...
        if(type==null){
            ...
            return createAtomicVar(name, null, getDefaultSerializer());
        }
        return ret;
    }
@jankotek
Copy link
Owner

Store does not allow null values, which is initial value for Atomic.Var. I changed default value to empty string "". This is not issue in 2.0, since store handles null values.

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

No branches or pull requests

2 participants