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

Revert "rdbms::ConnPool now protects against being configired with a maximum of zero connections"

This reverts commit 18b07b1f.
parent 18b07b1f
No related branches found
No related tags found
No related merge requests found
......@@ -38,7 +38,7 @@ TEST_F(cta_catalogue_InMemoryCatalogue, createSameSchemaInTwoSeparateInMemoryDat
log::DummyLogger dummyLog("dummy", "dummy");
const uint64_t nbConns = 1;
const uint64_t nbArchiveFileListingConns = 1;
const uint64_t nbArchiveFileListingConns = 0;
// First in-memory database
{
......@@ -56,7 +56,7 @@ TEST_F(cta_catalogue_InMemoryCatalogue, schemaTables) {
log::DummyLogger dummyLog("dummy", "dummy");
const uint64_t nbConns = 1;
const uint64_t nbArchiveFileListingConns = 1;
const uint64_t nbArchiveFileListingConns = 0;
catalogue::InMemoryCatalogue inMemoryCatalogue(dummyLog, nbConns, nbArchiveFileListingConns);
const auto tableNameList = inMemoryCatalogue.getTableNames();
......
......@@ -33,9 +33,7 @@ namespace rdbms {
ConnPool::ConnPool(const Login &login, const uint64_t maxNbConns):
m_connFactory(wrapper::ConnFactoryFactory::create(login)),
m_maxNbConns(maxNbConns),
m_nbConnsOnLoan(0) {
if(0 == m_maxNbConns) throw MaxNbConnsIsZero("Cannot instantiate ConnPool because maxNbConns=0");
m_nbConnsOnLoan(0){
}
//------------------------------------------------------------------------------
......
......@@ -18,7 +18,6 @@
#pragma once
#include "common/exception/Exception.hpp"
#include "common/threading/CondVar.hpp"
#include "common/threading/Mutex.hpp"
#include "rdbms/ConnAndStmts.hpp"
......@@ -40,8 +39,6 @@ class Login;
class ConnPool {
public:
CTA_GENERATE_EXCEPTION_CLASS(MaxNbConnsIsZero);
/**
* Constructor.
*
......@@ -49,7 +46,6 @@ public:
* connections.
* @param maxNbConns The maximum number of database connections within the
* pool.
* @throw MaxNbConnsIsZero if maxNbConns is set to 0.
*/
ConnPool(const Login &login, const uint64_t maxNbConns);
......
......@@ -34,14 +34,6 @@ protected:
}
};
TEST_F(cta_rdbms_ConnPoolTest, MaxNbConnsIsZero) {
using namespace cta::rdbms;
const Login login(Login::DBTYPE_SQLITE, "", "", "file::memory:?cache=shared", "", 0);
const uint64_t nbConns = 0;
ASSERT_THROW(ConnPool pool(login, nbConns), ConnPool::MaxNbConnsIsZero);
}
TEST_F(cta_rdbms_ConnPoolTest, getPooledConn) {
using namespace cta::rdbms;
......
......@@ -55,7 +55,7 @@ const uint32_t TEST_GROUP_2 = 9754;
rdbms::Login catalogueLogin(rdbms::Login::DBTYPE_IN_MEMORY, "", "", "", "", 0);
const uint64_t nbConns = 1;
const uint64_t nbArchiveFileListingConns = 1;
const uint64_t nbArchiveFileListingConns = 0;
auto catalogueFactory = CatalogueFactoryFactory::create(m_dummyLog, catalogueLogin, nbConns,
nbArchiveFileListingConns);
m_catalogue = catalogueFactory->create();
......
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