Revision 8661

View differences:

org.gvsig.vcsgis/trunk/org.gvsig.vcsgis/org.gvsig.vcsgis.lib/org.gvsig.vcsgis.lib.impl/src/main/java/org/gvsig/vcsgis/lib/workspace/StoreProperties.java
56 56
        store.setProperty(STORE_PROPERTY_ENTITY, STORE_NOT_IN_VCS);
57 57
    }
58 58
    
59
    public static void setUnknownVCSMode(FeatureStore store) {
60
        if( store == null ) {
61
            return;
62
        }
63
        store.setProperty(STORE_PROPERTY_WORKSPACE, null);
64
        store.setProperty(STORE_PROPERTY_ENTITY, null);
65
    }
66
    
59 67
    public static int getVCSMode(FeatureStore store) {
60 68
        String workspace_code = (String) store.getProperty(STORE_PROPERTY_WORKSPACE);
61 69
        if( workspace_code==null ) {
org.gvsig.vcsgis/trunk/org.gvsig.vcsgis/org.gvsig.vcsgis.lib/org.gvsig.vcsgis.lib.impl/src/main/java/org/gvsig/vcsgis/lib/VCSGisManagerImpl.java
63 63
import org.gvsig.fmap.dal.store.jdbc.JDBCStoreParameters;
64 64
import org.gvsig.fmap.dal.store.jdbc2.JDBCServerExplorer;
65 65
import org.gvsig.fmap.geom.primitive.Envelope;
66
import org.gvsig.json.Json;
67 66
import org.gvsig.json.JsonManager;
68 67
import org.gvsig.tools.ToolsLocator;
69 68
import org.gvsig.tools.dispose.DisposeUtils;
......
112 111
import org.gvsig.vcsgis.lib.workspace.VCSGisWorkspaceDescriptor;
113 112
import org.gvsig.vcsgis.lib.workspace.VCSGisWorkspaceDescriptorImpl;
114 113
import org.gvsig.vcsgis.lib.workspace.VCSGisWorkspaceImpl;
115
import static org.gvsig.vcsgis.lib.workspace.VCSGisWorkspaceImpl.CONFIG_REPOSITORY_NAME;
116 114
import org.gvsig.vcsgis.lib.workspace.tables.EntitiesTable;
117 115
import org.gvsig.vcsgis.lib.workspace.tables.EntitiesTable.EntityRow;
118 116
import org.gvsig.vcsgis.lib.workspace.tables.LocalRevisionsTable;
......
176 174
    }
177 175
    
178 176
    @Override
179
    public void clean() {
177
    public synchronized void clean() {
180 178
        for (VCSGisWorkspaceDescriptor workspace : workspaces.values()) {
181 179
            DisposeUtils.disposeQuietly(workspace);
182 180
        }
......
191 189
    }
192 190

  
193 191
    @Override
194
    public void restoreWorkspaces(Map<String, VCSGisWorkspaceDescriptor> descriptors) {
192
    public synchronized void restoreWorkspaces(Map<String, VCSGisWorkspaceDescriptor> descriptors) {
195 193
        this.workspaces = new HashMap<>();
196 194
        if( descriptors != null ) {
197 195
            this.workspaces.putAll(descriptors);
......
548 546

  
549 547
                    String storeUrl = ((JDBCStoreParameters)params).getUrl();
550 548
                    for (VCSGisWorkspaceDescriptor value : this.workspaces.values()) {
549
                        if( value == null ||
550
                                value.getExplorerParameters() == null ||
551
                                value.getWorkspace() == null ) {
552
                            continue;
553
                        }
551 554
                        if (StringUtils.equals(storeUrl, value.getExplorerParameters().getUrl())) {
552 555
                            workspace = (VCSGisWorkspaceImpl) value.getWorkspace();
553 556
                            EntityRow entity = (EntityRow) workspace.getWorkspaceEntityByName(entity_name);
......
595 598
            }
596 599
        } catch (Exception ex) {
597 600
            LOGGER.warn("Can't get '" +store.getName()+ "'store's workspace ", ex);
598
            StoreProperties.setNotVCSMode(store);
599
            return null;
601
            StoreProperties.setUnknownVCSMode(store);
602
            throw new RuntimeException("Can't get '" +store.getName()+ "'store's workspace ", ex);
600 603
        }
601 604
    }
602 605

  

Also available in: Unified diff