diff --git a/include/caosdb/transaction.h b/include/caosdb/transaction.h index cc7502c8439e36623a11d9c6602f4c433d14e687..8b7dd9593f3d8b3ada661bf02e5e141ab1f7b0c4 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 497629b69b257a8bea6c10f621a9987f8fabc8d2..f998cebc10a72c55a34b75aca7955ca95db038a1 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;