Revision 46214
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.h2spatial/org.gvsig.h2spatial.h2gis132/org.gvsig.h2spatial.h2gis132.provider/src/main/java/org/gvsig/fmap/dal/impl/LargeSetImpl.java | ||
---|---|---|
9 | 9 |
import java.util.Collection; |
10 | 10 |
import java.util.Iterator; |
11 | 11 |
import java.util.Set; |
12 |
import org.apache.commons.io.FileUtils; |
|
12 | 13 |
import org.gvsig.fmap.dal.DALLocator; |
13 | 14 |
import org.gvsig.fmap.dal.DataManager; |
14 | 15 |
import org.gvsig.tools.ToolsLocator; |
... | ... | |
34 | 35 |
|
35 | 36 |
protected static final Logger LOGGER = LoggerFactory.getLogger(LargeSetImpl.class); |
36 | 37 |
|
38 |
private final File f; |
|
37 | 39 |
private MVStore mvstore; |
38 | 40 |
private MVMap<K, Boolean> mvMap; |
39 | 41 |
|
40 | 42 |
public LargeSetImpl() { |
41 | 43 |
super(); |
42 | 44 |
FoldersManager folderManager = ToolsLocator.getFoldersManager(); |
43 |
File f = folderManager.getUniqueTemporaryFile("MinLargeSet.mv");
|
|
45 |
this.f = folderManager.getUniqueTemporaryFile("MinLargeSet.mv");
|
|
44 | 46 |
this.mvstore = MVStore.open(f.getAbsolutePath()); |
45 | 47 |
this.mvMap = mvstore.openMap("DefaultMap"); |
46 | 48 |
} |
47 | 49 |
|
48 | 50 |
@Override |
49 | 51 |
protected void doDispose() throws BaseException { |
50 |
this.mvstore.close(); |
|
52 |
this.mvstore.closeImmediately();
|
|
51 | 53 |
this.mvMap = null; |
52 | 54 |
this.mvstore = null; |
55 |
FileUtils.deleteQuietly(f); |
|
53 | 56 |
} |
54 | 57 |
|
55 | 58 |
@Override |
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.h2spatial/org.gvsig.h2spatial.h2gis132/org.gvsig.h2spatial.h2gis132.provider/src/main/java/org/gvsig/fmap/dal/impl/LargeMapImpl.java | ||
---|---|---|
28 | 28 |
import java.util.Map; |
29 | 29 |
import java.util.Map.Entry; |
30 | 30 |
import java.util.Set; |
31 |
import org.apache.commons.io.FileUtils; |
|
31 | 32 |
import org.gvsig.fmap.dal.DALLocator; |
32 | 33 |
import org.gvsig.fmap.dal.DataManager; |
33 | 34 |
import org.gvsig.tools.ToolsLocator; |
... | ... | |
56 | 57 |
|
57 | 58 |
protected static final Logger LOGGER = LoggerFactory.getLogger(LargeMapImpl.class); |
58 | 59 |
|
60 |
private final File f; |
|
59 | 61 |
private MVStore mvstore; |
60 | 62 |
private MVMap<K, V> mvMap; |
61 | 63 |
|
62 | 64 |
public LargeMapImpl() { |
63 | 65 |
super(); |
64 | 66 |
FoldersManager folderManager = ToolsLocator.getFoldersManager(); |
65 |
File f = folderManager.getUniqueTemporaryFile("MinLargeMap.mv");
|
|
67 |
this.f = folderManager.getUniqueTemporaryFile("MinLargeMap.mv");
|
|
66 | 68 |
this.mvstore = MVStore.open(f.getAbsolutePath()); |
67 | 69 |
this.mvMap = mvstore.openMap("DefaultMap"); |
68 | 70 |
} |
... | ... | |
74 | 76 |
|
75 | 77 |
@Override |
76 | 78 |
protected void doDispose() throws BaseException { |
77 |
this.mvstore.close(); |
|
79 |
this.mvstore.closeImmediately(); |
|
80 |
FileUtils.deleteQuietly(f); |
|
78 | 81 |
this.mvMap = null; |
79 | 82 |
this.mvstore = null; |
80 | 83 |
} |
Also available in: Unified diff