Fast path in transaction manager for single update scenarios

Change-Id: Ia0ad61aabf5c35fbfadc5b127662edb497bcc9c0
diff --git a/core/store/primitives/src/main/java/org/onosproject/store/primitives/impl/TransactionManager.java b/core/store/primitives/src/main/java/org/onosproject/store/primitives/impl/TransactionManager.java
index 30aebb1..02a9fde 100644
--- a/core/store/primitives/src/main/java/org/onosproject/store/primitives/impl/TransactionManager.java
+++ b/core/store/primitives/src/main/java/org/onosproject/store/primitives/impl/TransactionManager.java
@@ -50,6 +50,12 @@
      * @return transaction commit result
      */
     public CompletableFuture<CommitResult> execute(Transaction transaction) {
+        // short-circuit if there is only a single update
+        if (transaction.updates().size() <= 1) {
+            return database.prepareAndCommit(transaction)
+                    .thenApply(response -> response.success()
+                                   ? CommitResult.OK : CommitResult.FAILURE_DURING_COMMIT);
+        }
         // clean up if this transaction in already in a terminal state.
         if (transaction.state() == COMMITTED || transaction.state() == ROLLEDBACK) {
             return transactions.remove(transaction.id()).thenApply(v -> CommitResult.OK);