You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a Map<enum_type, Map<String, my_class>> where the value Map<String, my_class> of any entry I add keeps resetting to a new HashMap.
The DB is created this way: var db = DBMaker.fileDB(db_path).transactionEnable().make();
whereas the map itself is created this way: Map<enum_type, Map<String, my_class>> my_map = (Map<enum_type, Map<String, my_class>>) db.hashMap(name).createOrOpen();
This may be a serialization/mutability issue rather than MapDB recreating the value by itself. If the nested Map<String, my_class> is a normal HashMap, each update needs to write the modified value back to the outer map, and the value serializer must be able to serialize my_class deterministically. A minimal example showing whether the nested map is mutated after put, whether db.commit() is called, and which serializer is configured would make the behavior much clearer.
Activity
hiSandog commentedon Jul 3, 2026
This may be a serialization/mutability issue rather than MapDB recreating the value by itself. If the nested
Map<String, my_class>is a normalHashMap, each update needs to write the modified value back to the outer map, and the value serializer must be able to serializemy_classdeterministically. A minimal example showing whether the nested map is mutated afterput, whetherdb.commit()is called, and which serializer is configured would make the behavior much clearer.