Make sure transaction applies whole removal list 06/5106/1
authorTony Tkacik <ttkacik@cisco.com>
Mon, 3 Feb 2014 18:33:52 +0000 (19:33 +0100)
committerTony Tkacik <ttkacik@cisco.com>
Mon, 3 Feb 2014 18:33:52 +0000 (19:33 +0100)
Change-Id: I53d1cf10bce6e444f80b13d9ce57e5f1ef2eb5c9
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
opendaylight/md-sal/sal-common-impl/src/main/java/org/opendaylight/controller/md/sal/common/impl/AbstractDataModification.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/impl/HashMapDataStore.xtend

index 9a61e98..4b6a018 100644 (file)
@@ -75,7 +75,6 @@ public abstract class AbstractDataModification<P extends Path<P>, D> implements
         }
 
         configurationUpdate.put(path, mergeConfigurationData(path,original, data));
-        configurationRemove.remove(path);
     }
 
     @Override
@@ -86,7 +85,6 @@ public abstract class AbstractDataModification<P extends Path<P>, D> implements
             operationalCreated.put(path, data);
         }
         operationalUpdate.put(path, mergeOperationalData(path,original,data));
-        operationalRemove.remove(path);
     }
 
     @Override
index 5fc2c1d..9600881 100644 (file)
@@ -64,15 +64,15 @@ class HashMapDataStore implements DataStore, AutoCloseable {
 
     def RpcResult<Void> finish(HashMapDataStoreTransaction transaction) {
         val modification = transaction.modification;
-        configuration.putAll(modification.updatedConfigurationData);
-        operational.putAll(modification.updatedOperationalData);
-
         for (removal : modification.removedConfigurationData) {
             remove(configuration,removal);
         }
         for (removal : modification.removedOperationalData) {
             remove(operational,removal);
         }
+        configuration.putAll(modification.updatedConfigurationData);
+        operational.putAll(modification.updatedOperationalData);
+
         return Rpcs.getRpcResult(true, null, Collections.emptySet);
     }