From 636ca4771ec9ec50d68b26cc6bcab9edd6548e07 Mon Sep 17 00:00:00 2001
From: Timm Fitschen <t.fitschen@indiscale.com>
Date: Thu, 29 Jul 2021 17:06:00 +0200
Subject: [PATCH] WIP: inser delete

---
 include/caosdb/transaction.h |  2 +-
 src/caosdb/transaction.cpp   | 12 ++++++------
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/include/caosdb/transaction.h b/include/caosdb/transaction.h
index cc7502c..8b7dd95 100644
--- a/include/caosdb/transaction.h
+++ b/include/caosdb/transaction.h
@@ -65,7 +65,7 @@ private:
 class Transaction {
 private:
   mutable std::unique_ptr<ResultSet> result_set;
-  TransactionStatus status = TransactionStatus::INITIAL();
+  mutable TransactionStatus status = TransactionStatus::INITIAL();
   std::shared_ptr<EntityTransactionService::Stub> service_stub;
   MultiTransactionRequest *request;
   mutable MultiTransactionResponse *response;
diff --git a/src/caosdb/transaction.cpp b/src/caosdb/transaction.cpp
index 497629b..f998ceb 100644
--- a/src/caosdb/transaction.cpp
+++ b/src/caosdb/transaction.cpp
@@ -206,24 +206,24 @@ auto Transaction::WaitForIt() const noexcept -> TransactionStatus {
     case WrappedResponseCase::kRetrieveResponse: {
       auto *entity = responses->mutable_retrieve_response()->release_entity();
       if (!entity->errors().empty()) {
-        this->status =
-          TransactionStatus::TRANSACTION_ERROR("The request returned with errors.");
+        this->status = TransactionStatus::TRANSACTION_ERROR(
+          "The request returned with errors.");
       }
       this->result_set = std::make_unique<UniqueResult>(entity);
     } break;
     case WrappedResponseCase::kInsertResponse: {
       auto *insertedIdResponse = responses->mutable_insert_response();
       if (!insertedIdResponse->entity_errors().empty()) {
-        this->status =
-          TransactionStatus::TRANSACTION_ERROR("The request returned with errors.");
+        this->status = TransactionStatus::TRANSACTION_ERROR(
+          "The request returned with errors.");
       }
       this->result_set = std::make_unique<UniqueResult>(insertedIdResponse);
     } break;
     case WrappedResponseCase::kDeleteResponse: {
       auto *deletedIdResponse = responses->mutable_delete_response();
       if (!deletedIdResponse->entity_errors().empty()) {
-        this->status =
-          TransactionStatus::TRANSACTION_ERROR("The request returned with errors.");
+        this->status = TransactionStatus::TRANSACTION_ERROR(
+          "The request returned with errors.");
       }
       this->result_set = std::make_unique<UniqueResult>(deletedIdResponse);
     } break;
-- 
GitLab