Changes to MVStore.getMetaMap() does not trigger commit()

52 views
Skip to first unread message

Chris van Hinsbergen

unread,
Jun 10, 2024, 5:57:57 AMJun 10
to H2 Database
I found an issue, not sure it is a design choice or a bug. When I open a new MVStore, and I only add entries in the meta map using MVStore.getMetaMap().put("some","thing"), and I call store.commit(), it returns -1. Closing the store and reopening it leaves me with a database that does not have any metadata.

However, when I also add an entry to some map, the data in the metamap IS stored. So adding data to the meta map does not trigger the store to have unsaved changes, but the metadata IS stored.

Is this intended behavior?

Thanks!

Chris

Andrei Tokar

unread,
Jun 10, 2024, 10:00:19 PMJun 10
to H2 Database
Hello Chris,
Just wondering what is your reason to call MVStore.getMetaMap()?
But if you do, please read it's javadoc:
This data is for informational purposes only.
The data is subject to change in future versions.
The data in this map should not be modified (changing system data may corrupt the store).

Chris van Hinsbergen

unread,
Jun 11, 2024, 2:49:28 AMJun 11
to H2 Database
Hi Andrei,

Sorry, I missed that javadoc (RTFM, I know). I was looking for a place to store meta data about what's in the database (i.e. timestamps of when certain computations were finished and stored in the database). I could have used my own MVMap, but this was already available and seemed like the perfect tool for the job.

Just a question, since it is for "internal" use only, why is it public?

Chris

Op dinsdag 11 juni 2024 om 04:00:19 UTC+2 schreef Andrei Tokar:
Reply all
Reply to author
Forward
0 new messages