Skip to content
This repository has been archived by the owner on May 21, 2024. It is now read-only.

Commit

Permalink
Remove unnecessary transactions
Browse files Browse the repository at this point in the history
The wcommit/wabort API is left as a placeholder. We'll add actual
functionality once SQL database is reworked to have a separate table
for file blobs.

Signed-off-by: Anton Gerasimov <[email protected]>
  • Loading branch information
Anton Gerasimov committed Dec 13, 2018
1 parent 4086bda commit 12ecdd5
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/libaktualizr/storage/sqlstorage.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1122,11 +1122,15 @@ class SQLTargetWHandle : public StorageTargetWHandle {
}

row_id_ = sqlite3_last_insert_rowid(db_.get());

if (!db_.commitTransaction()) {
throw exc;
}
}

~SQLTargetWHandle() override {
if (!closed_) {
db_.commitTransaction();
wcommit();
}
}

Expand Down Expand Up @@ -1162,15 +1166,9 @@ class SQLTargetWHandle : public StorageTargetWHandle {
return size;
}

void wcommit() override {
closed_ = true;
db_.commitTransaction();
}
void wcommit() override { closed_ = true; }

void wabort() noexcept override {
closed_ = true;
db_.rollbackTransaction();
}
void wabort() noexcept override { closed_ = true; }
friend class SQLTargetRHandle;

private:
Expand Down

0 comments on commit 12ecdd5

Please sign in to comment.