Revision 44189 trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.impl/src/main/java/org/gvsig/fmap/dal/feature/impl/DefaultFeatureStore.java

View differences:

DefaultFeatureStore.java
617 617
        } catch(Throwable th) {
618 618
            state.setBreakingsCause(th);
619 619
        }
620

  
621 620
        try {
622 621
            selection = (FeatureSelection) state.get("selection");
623 622
        } catch(Throwable th) {
......
1203 1202
            notifyChange(FeatureStoreNotification.BEFORE_UPDATE_TYPE, type);
1204 1203
            newVersionOfUpdate();
1205 1204
            
1205
            FeatureType oldt = type.getSource().getCopy();
1206
            FeatureType newt = type.getCopy();
1207
            commands.update(newt, oldt);
1206 1208
            if (typehasStrongChanges) { 
1207
                FeatureType oldt = type.getSource().getCopy();
1208
                FeatureType newt = type.getCopy();
1209
                commands.update(newt, oldt);
1210 1209
                hasStrongChanges = true;
1211
            } else {
1212
                boolean ok = this.featureTypes.remove(this.defaultFeatureType);
1213
                this.defaultFeatureType = type.getNotEditableCopy();
1214
                if (ok) {
1215
                    this.featureTypes.add(this.defaultFeatureType);
1216
                }
1217 1210
            }
1218 1211
            notifyChange(FeatureStoreNotification.AFTER_UPDATE_TYPE, type);
1219 1212
        } catch (Exception e) {
......
1457 1450
                    selection = null;
1458 1451
                }
1459 1452
                notifyChange(FeatureStoreNotification.BEFORE_FINISHEDITING);
1453
                saveDALFile();
1460 1454
                provider.endAppend();
1461 1455
                exitEditingMode();
1462 1456
                this.updateComputedFields(computedFields);
1463
                saveDALFile();
1457
                loadDALFile();
1464 1458
                updateIndexes();
1465 1459
                notifyChange(FeatureStoreNotification.AFTER_FINISHEDITING);
1466 1460
                break;
......
1469 1463
                if (hasStrongChanges && !this.allowWrite()) {
1470 1464
                    throw new WriteNotAllowedException(getName());
1471 1465
                }
1466
                saveDALFile();
1472 1467
                if(featureManager.isSelectionCompromised() && selection!=null ) {
1473 1468
                    selection = null;
1474 1469
                }
......
1486 1481
                        removeCalculatedAttributes(featureTypeManager.getFeatureTypesChanged()).iterator());
1487 1482
                    
1488 1483
                }  
1489
                exitEditingMode();
1490 1484
                this.updateComputedFields(computedFields);
1491
                saveDALFile();
1485
                exitEditingMode();
1486
                loadDALFile();
1492 1487
                updateIndexes();
1493 1488
                notifyChange(FeatureStoreNotification.AFTER_FINISHEDITING);
1494 1489
                break;

Also available in: Unified diff