Now, if you close sync the page file to disk and close it properly,
your indexes should stay intact so it should be possible to re-open
it. You would just need to store the free page list externally after
closing the file and restore it after reopening. I've just update the
Allocator API so that it's possible to get that free page list. So
basically you would be calling the following methods:
pageFile.allocator().getFreeRanges()
pageFile.allocator().setFreeRanges()
Regards,
Hiram
--
Regards,
Hiram
Blog: http://hiramchirino.com
Open Source SOA
http://fusesource.com/
But, another question coming in my mind: will this combination of
calls delete all previously associated page files?
--
Sergio Bossa
http://www.linkedin.com/in/sergiob
Which combination? :) Could you post an example of your call sequence?
if you want to make sure the previous page file is deleted, you could
always just File.delete().
> On Thu, Jul 8, 2010 at 6:07 PM, Sergio B. <sergio...@gmail.com> wrote:
>> Hi guys,
>>
>> I'm thinking about using HawtDB to implement a static (snapshot-like)
>> database, where I need to recreate from scratch the database file
>> several times, so I was wondering: what happens if I call
>> PageFileFactory#open() method on the same file multiple times (that
>> is, I always set the same file)?
>> It seems to always open a new database, discarding old data: can you
>> confirm this?
>>
>> Thanks,
>> Cheers,
>>
>> Sergio B.
>
>
>
> --
> Sergio Bossa
> http://www.linkedin.com/in/sergiob
>
--
yep
>> if you want to make sure the previous page file is deleted, you could
>> always just File.delete().
>
> Absolutely, but I wanted to understand how page allocation worked.
>
> Thanks,
> Cheers,
>
> Sergio B.
--