From 4ff33a560f2d3a332086f417f668600c0022bb43 Mon Sep 17 00:00:00 2001
From: Steven Murray <Steven.Murray@cern.ch>
Date: Mon, 29 Jan 2018 11:10:55 +0100
Subject: [PATCH] Revert "cta/CTA#186 CTA should cope with idle database
 connections being dropped by the database server"

This reverts commit 610e08b31add8b87afb37c1a7604a1ddcb10099e.
---
 catalogue/OracleCatalogue.cpp | 35 +----------------------------------
 catalogue/OracleCatalogue.hpp | 10 ----------
 2 files changed, 1 insertion(+), 44 deletions(-)

diff --git a/catalogue/OracleCatalogue.cpp b/catalogue/OracleCatalogue.cpp
index be04897bb9..308baaea69 100644
--- a/catalogue/OracleCatalogue.cpp
+++ b/catalogue/OracleCatalogue.cpp
@@ -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) {
diff --git a/catalogue/OracleCatalogue.hpp b/catalogue/OracleCatalogue.hpp
index 6e4e1896f5..99a404752a 100644
--- a/catalogue/OracleCatalogue.hpp
+++ b/catalogue/OracleCatalogue.hpp
@@ -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.
    *
-- 
GitLab