summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMykola Korniichuk <mkorniichuk@luxoft.com>2019-08-30 14:07:27 +0300
committerMykola Korniichuk <mkorniichuk@luxoft.com>2019-08-30 14:14:20 +0300
commitce477b8173be975b504af798b39b41f9bf660063 (patch)
treedaac600de9e9a15fc2ed3546d53a6d777864742a
parentd2584710fb35e0bb2db037a0b2d971fd6cf6b316 (diff)
downloadsdl_core-feature/read_generic_network_signal_data.tar.gz
DeleteVehicleDataItems without transactionfeature/read_generic_network_signal_data
-rw-r--r--src/components/policy/policy_external/src/sql_pt_representation.cc7
-rw-r--r--src/components/policy/policy_regular/src/sql_pt_representation.cc6
2 files changed, 4 insertions, 9 deletions
diff --git a/src/components/policy/policy_external/src/sql_pt_representation.cc b/src/components/policy/policy_external/src/sql_pt_representation.cc
index 03d436c419..7874abc4ee 100644
--- a/src/components/policy/policy_external/src/sql_pt_representation.cc
+++ b/src/components/policy/policy_external/src/sql_pt_representation.cc
@@ -1788,22 +1788,19 @@ SQLPTRepresentation::SelectPrimitiveVehicleDataItems() const {
bool SQLPTRepresentation::DeleteVehicleDataItems() const {
utils::dbms::SQLQuery query(db());
- db_->BeginTransaction();
+ LOG4CXX_AUTO_TRACE(logger_);
+
if (!query.Exec(sql_pt::kDeleteVehicleDataItems)) {
LOG4CXX_ERROR(logger_,
"Failed clearing database: " << query.LastError().text());
- db_->RollbackTransaction();
return false;
}
if (!query.Exec(sql_pt::kDeleteVehicleDataItemParams)) {
LOG4CXX_ERROR(logger_,
"Failed clearing database: " << query.LastError().text());
- db_->RollbackTransaction();
return false;
}
- db_->CommitTransaction();
-
return true;
}
diff --git a/src/components/policy/policy_regular/src/sql_pt_representation.cc b/src/components/policy/policy_regular/src/sql_pt_representation.cc
index 781e45ba58..ce0527600a 100644
--- a/src/components/policy/policy_regular/src/sql_pt_representation.cc
+++ b/src/components/policy/policy_regular/src/sql_pt_representation.cc
@@ -2770,21 +2770,19 @@ SQLPTRepresentation::SelectPrimitiveVehicleDataItems() const {
bool SQLPTRepresentation::DeleteVehicleDataItems() const {
utils::dbms::SQLQuery query(db());
- db_->BeginTransaction();
+ LOG4CXX_AUTO_TRACE(logger_);
+
if (!query.Exec(sql_pt::kDeleteVehicleDataItems)) {
LOG4CXX_ERROR(logger_,
"Failed clearing database: " << query.LastError().text());
- db_->RollbackTransaction();
return false;
}
if (!query.Exec(sql_pt::kDeleteVehicleDataItemParams)) {
LOG4CXX_ERROR(logger_,
"Failed clearing database: " << query.LastError().text());
- db_->RollbackTransaction();
return false;
}
- db_->CommitTransaction();
return true;
}