Reduce use of deprecated methods
[controller.git] / benchmark / dsbenchmark / src / main / java / org / opendaylight / dsbenchmark / simpletx / SimpletxDomWrite.java
index e55724d54bdebca1bb3e451df7a9a3d9a70cbf4c..49765b3b9415acba3f4a05b243b211b84aa7cb90 100644 (file)
@@ -9,8 +9,8 @@
 package org.opendaylight.dsbenchmark.simpletx;
 
 import java.util.List;
+import java.util.concurrent.ExecutionException;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
 import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
 import org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction;
 import org.opendaylight.dsbenchmark.DatastoreAbstractWriter;
@@ -65,9 +65,9 @@ public class SimpletxDomWrite extends DatastoreAbstractWriter {
 
             if (writeCnt == writesPerTx) {
                 try {
-                    tx.submit().checkedGet();
+                    tx.commit().get();
                     txOk++;
-                } catch (final TransactionCommitFailedException e) {
+                } catch (final InterruptedException | ExecutionException e) {
                     LOG.error("Transaction failed", e);
                     txError++;
                 }
@@ -78,12 +78,10 @@ public class SimpletxDomWrite extends DatastoreAbstractWriter {
 
         if (writeCnt != 0) {
             try {
-                tx.submit().checkedGet();
-            } catch (final TransactionCommitFailedException e) {
+                tx.commit().get();
+            } catch (final InterruptedException | ExecutionException e) {
                 LOG.error("Transaction failed", e);
             }
         }
-
     }
-
 }