Hi,

Hm, this is a tricky problem. I understand one would expect a rollback
should restore the data.

As for the in-memory case: the roots pages of all maps are currently kept
in the map object itself, and removing a map will remove the reference from
the store to the map, that means the references to the root pages are also
removed. I'm not quite sure how to change that.

As for the persistent case: it might be possible to work around the
limitation, but it would be different from the in-memory case.

The best solution might be to add a reference from the meta map to the root
pages of each map (for both the in-memory and the persistent case).

If done correctly, it might actually simplify the design, as only the
metadata map would really be needed for all operations (store, rollback,
but also put and get). But this is a bigger change; it also affects
concurrency and so on. I need to think about this.

In the next beta version of H2, I will not change this yet. As for now, I
suggest to use MVMap.clear in case you need to rollback the change. That
should work well.

Does this solve your immediate problem? I understand long term, a better
solution would be nice.

Regards,
Thomas







On Sun, Aug 3, 2014 at 11:20 PM, Konrad Eriksson <[email protected]>
wrote:

> Hi,
>
> I just started to explore the new MVStore because it's support for
> versions.
>
> But I ran into some strange behaviour with the content of MVMap:s when
> using MVStore.rollback().
>
> It seems like a non-map that was removed is empty after rollback.
>
> Reproduce:
> 1) Open a new map and insert one entry (key1=value1)
> 2) Commit
> 3) Remove map
> 4) Rollback
> 5) The map seems to exist again but when opening it it's empty
>
> Is this a bug or am I missing something?
>
> I'm testing this against h2-1.4.180.
> See attached Java-code for a jUnit test reproducing it.
>
>
> Kind regards,
> Konrad
>
> --
> You received this message because you are subscribed to the Google Groups
> "H2 Database" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/h2-database.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.

Reply via email to