Null write transaction when cancel is called 98/52198/2
authorAndrej Mak <andrej.mak@pantheon.tech>
Thu, 23 Feb 2017 07:13:36 +0000 (08:13 +0100)
committerAndrej Mak <andrej.mak@pantheon.tech>
Thu, 23 Feb 2017 07:18:15 +0000 (08:18 +0100)
Write transaction is finished and can't be used anymore.

Change-Id: Id9efcab3ca0161d5dba4cef3b56e6e568c1b1e6c
Signed-off-by: Andrej Mak <andrej.mak@pantheon.tech>
netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/tx/NetconfMasterDOMTransaction.java

index 973cc0576715843894a72cb2fe84cabe5c56a9c2..269ee2f43cb2a4ee95df8e801455bcd20b436400 100644 (file)
@@ -152,8 +152,11 @@ public class NetconfMasterDOMTransaction implements NetconfDOMTransaction {
     @Override
     public boolean cancel() {
         LOG.trace("{}: Cancel[{}} via NETCONF", id, writeTx.getIdentifier());
-
-        return writeTx.cancel();
+        try {
+            return writeTx.cancel();
+        } finally {
+            writeTx = null;
+        }
     }
 
     @Override