Hi, I think I will remove MVMap.close(). I currently don't see a reason to support it. For read-only maps, Java garbage collection should release the memory, and for writable maps, MVMap.close() is problematic. One possible use case is to make the map read-only, but I don't think it's a strong enough use case.
Internally, calling removeMap() will still do something similar to closing the map, but in addition to that will also remove all data. Regards, Thomas Hi, Yes, this is a bug, I will fix it. Thanks for reporting it! Regards, Thomas On Thu, Oct 3, 2013 at 1:31 AM, Brian Bray <[email protected]> wrote: > This test throws a "Map is closed" exception (in 1.3.173) and I don't > believe it should. Looks like MVMap.openMap(...) is not checking for > "!old.isClosed()"? > > @Test > public void testMVMapClearReOpen() { > // open MVMap > File f = new File(System.getProperty("java.io.tmpdir"), "cache.data"); > MVStore store = new > MVStore.Builder().fileName(f.getAbsolutePath()).open(); > MVMap<String,Object> map = store.openMap("foo"); > > // should initally be empty > assertTrue(map.isEmpty()); > > // add one item and close > map.put("foo", "bar"); > assertEquals(1, map.getSize()); > map.close(); > > // re-open, should still have 1 item it, clear all items and close > map = store.openMap("foo"); > assertEquals(1, map.getSize()); > map.clear(); > assertEquals(0, map.getSize()); > map.close(); > > // re-open, should have 0 items > map = store.openMap("foo"); > assertTrue(map.isEmpty()); > map.close(); > } > > -- > 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/groups/opt_out. > -- 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/groups/opt_out.
