Hi Thomas,

On Monday, August 4, 2014 8:08:39 PM UTC+1, Thomas Mueller wrote:
>
> 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. 
>
I see the problem.
Since meta-map seems to remember what maps existed at earlier versions then 
you might think that it should also remember what was in them at that point.
 

>
> As for the persistent case: it might be possible to work around the 
> limitation, but it would be different from the in-memory case.
>
I guess you could have different behaviour for in-memory vs persistent but 
I see how that might cause headache for people when they switch between the 
two modes (for testing for example).


> 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).
>
That sounds like a possible solution. I guess pages are never really 
deleted (to be able to go back to earlier versions) if I understand it 
correctly.

>
> 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.
>
I tried this solution earlier and it seems to solve the data consistency.
I'm just afraid it might slow down the lookup of maps since I create a lot 
of maps and if I just clear them instead of deleting them they are still in 
the active meta-map right?

This brings me to a question I've been thinking about. Is it possible to 
reference another map directly from a map (value)?
Basically could I implement my own meta-map that I can use as index for 
lookup within a sub-group of maps (without having to put all maps in the 
global meta-map)?



> Regards,
> Thomas
>
>
>
>
>
>
>
> On Sun, Aug 3, 2014 at 11:20 PM, Konrad Eriksson <
> [email protected] <javascript:>> 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] <javascript:>.
>> To post to this group, send email to [email protected] 
>> <javascript:>.
>> 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