Commit 89d2a604 authored by Steven Murray's avatar Steven Murray
Browse files

Provided a simple implemention for Catalogue::ping()

parent 1557d1e8
......@@ -7136,4 +7136,10 @@ TEST_P(cta_catalogue_CatalogueTest, lockSchema_unlockSchema_lockSchema) {
ASSERT_TRUE(m_catalogue->schemaIsLocked());
}
TEST_P(cta_catalogue_CatalogueTest, ping) {
using namespace cta;
m_catalogue->ping();
}
} // namespace unitTests
......@@ -4519,7 +4519,15 @@ void RdbmsCatalogue::unlockSchema() {
// ping
//------------------------------------------------------------------------------
bool RdbmsCatalogue::ping() {
throw exception::Exception(std::string(__FUNCTION__) + " not implemented");
try {
const char *const sql = "SELECT COUNT(*) FROM CTA_CATALOGUE";
auto conn = m_connPool.getConn();
auto stmt = conn->createStmt(sql, rdbms::Stmt::AutocommitMode::OFF);
auto rset = stmt->executeQuery();
return true;
} catch(...) {
return false;
}
}
} // namespace catalogue
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment