Skip to content
Snippets Groups Projects
Commit 22685812 authored by Steven Murray's avatar Steven Murray
Browse files

SqliteCatalogue::filesWrittenToTape() no longer uses deferred transactions

parent 2a3da424
No related branches found
No related tags found
No related merge requests found
......@@ -234,7 +234,6 @@ void SqliteCatalogue::filesWrittenToTape(const std::set<TapeFileWritten> &events
std::lock_guard<std::mutex> m_lock(m_mutex);
auto conn = m_connPool.getConn();
rdbms::AutoRollback autoRollback(conn);
const auto tape = selectTape(conn, firstEvent.vid);
uint64_t expectedFSeq = tape.lastFSeq + 1;
......@@ -261,13 +260,12 @@ void SqliteCatalogue::filesWrittenToTape(const std::set<TapeFileWritten> &events
auto lastEventItor = events.cend();
lastEventItor--;
const TapeFileWritten &lastEvent = *lastEventItor;
updateTape(conn, rdbms::Stmt::AutocommitMode::OFF, lastEvent.vid, lastEvent.fSeq, totalCompressedBytesWritten,
updateTape(conn, rdbms::Stmt::AutocommitMode::ON, lastEvent.vid, lastEvent.fSeq, totalCompressedBytesWritten,
lastEvent.tapeDrive);
for(const auto &event : events) {
fileWrittenToTape(rdbms::Stmt::AutocommitMode::OFF, conn, event);
fileWrittenToTape(rdbms::Stmt::AutocommitMode::ON, conn, event);
}
conn.commit();
} catch(exception::Exception &ex) {
throw exception::Exception(std::string(__FUNCTION__) + " failed: " + ex.getMessage().str());
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment