Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
dCache
cta
Commits
0d76da86
Commit
0d76da86
authored
Oct 01, 2020
by
Steven Murray
Browse files
Revert "rdbms::ConnPool now protects against being configired with a maximum of zero connections"
This reverts commit
db9085e6
.
parent
db9085e6
Changes
5
Hide whitespace changes
Inline
Side-by-side
catalogue/InMemoryCatalogueTest.cpp
View file @
0d76da86
...
...
@@ -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
();
...
...
rdbms/ConnPool.cpp
View file @
0d76da86
...
...
@@ -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
){
}
//------------------------------------------------------------------------------
...
...
rdbms/ConnPool.hpp
View file @
0d76da86
...
...
@@ -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
);
...
...
rdbms/ConnPoolTest.cpp
View file @
0d76da86
...
...
@@ -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
;
...
...
tapeserver/castor/tape/tapeserver/daemon/MigrationReportPackerTest.cpp
View file @
0d76da86
...
...
@@ -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
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment