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

Revert "cta/CTA#186 CTA should cope with idle database connections being...

Revert "cta/CTA#186 CTA should cope with idle database connections being dropped by the database server"

This reverts commit 610e08b3.
parent 7504e732
No related branches found
No related tags found
No related merge requests found
......@@ -18,9 +18,8 @@
#include "catalogue/ArchiveFileRow.hpp"
#include "catalogue/OracleCatalogue.hpp"
#include "common/exception/Exception.hpp"
#include "common/exception/LostDatabaseConnection.hpp"
#include "common/exception/UserError.hpp"
#include "common/exception/Exception.hpp"
#include "common/make_unique.hpp"
#include "common/threading/MutexLocker.hpp"
#include "common/Timer.hpp"
......@@ -592,36 +591,6 @@ common::dataStructures::Tape OracleCatalogue::selectTapeForUpdate(rdbms::Conn &c
// filesWrittenToTape
//------------------------------------------------------------------------------
void OracleCatalogue::filesWrittenToTape(const std::set<TapeFileWritten> &events) {
try {
const uint32_t maxTries = 3;
for (uint32_t tryNb = 1; tryNb <= maxTries; tryNb++) {
try {
filesWrittenToTapeInternal(events);
} catch (exception::LostDatabaseConnection &lc) {
// Ignore lost connection
std::list<log::Param> params = {
{"maxTries", maxTries},
{"tryNb", tryNb},
{"msg", lc.getMessage()}
};
m_log(cta::log::WARNING, "Lost database connection", params);
}
}
exception::Exception ex;
ex.getMessage() << " failed: Lost the database connection after trying " << maxTries << " times";
throw ex;
} catch(exception::Exception &ex) {
throw exception::Exception(std::string(__FUNCTION__) + " failed: " + ex.getMessage().str());
} catch(std::exception &se) {
throw exception::Exception(std::string(__FUNCTION__) + " failed: " + se.what());
}
}
//------------------------------------------------------------------------------
// filesWrittenToTapeInternal
//------------------------------------------------------------------------------
void OracleCatalogue::filesWrittenToTapeInternal(const std::set<TapeFileWritten> &events) {
try {
if (events.empty()) {
return;
......@@ -723,8 +692,6 @@ void OracleCatalogue::filesWrittenToTapeInternal(const std::set<TapeFileWritten>
conn.commit();
} catch(exception::LostDatabaseConnection &) {
throw;
} catch(exception::Exception &ex) {
throw exception::Exception(std::string(__FUNCTION__) + " failed: " + ex.getMessage().str());
} catch(std::exception &se) {
......
......@@ -127,16 +127,6 @@ public:
private:
/**
* Notifies the catalogue that the specified files have been written to tape.
*
* This internal method can be re-tried if it throws a LostDatabaseConnection
* exception.
*
* @param events The tape file written events.
*/
void filesWrittenToTapeInternal(const std::set<TapeFileWritten> &events);
/**
* Selects the specified tape within the Tape table for update.
*
......
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