diff options
author | randomdan <randomdan@localhost> | 2011-12-16 20:05:52 +0000 |
---|---|---|
committer | randomdan <randomdan@localhost> | 2011-12-16 20:05:52 +0000 |
commit | 19aed06df786797d528ece7e1350771f6c79853c (patch) | |
tree | 09e86723b406d9d5e73e27390069670507d96b88 /project2/sql/rdbmsDataSource.cpp | |
parent | Improvements to the handling of command line arguments (diff) | |
download | project2-19aed06df786797d528ece7e1350771f6c79853c.tar.bz2 project2-19aed06df786797d528ece7e1350771f6c79853c.tar.xz project2-19aed06df786797d528ece7e1350771f6c79853c.zip |
Improved connection failure logging and instantiation
Diffstat (limited to 'project2/sql/rdbmsDataSource.cpp')
-rw-r--r-- | project2/sql/rdbmsDataSource.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/project2/sql/rdbmsDataSource.cpp b/project2/sql/rdbmsDataSource.cpp index 4c6ae17..305f1d7 100644 --- a/project2/sql/rdbmsDataSource.cpp +++ b/project2/sql/rdbmsDataSource.cpp @@ -159,6 +159,8 @@ RdbmsDataSource::connectTo(const ConnectionInfo & dsn) return db; } catch (const DB::ConnectionError & e) { + Logger()->messagef(LOG_NOTICE, "%s: connection error message to '%s' -> %s", + __PRETTY_FUNCTION__, dsn.dsn.c_str(), e.what()); failedhosts.insert(FailedHosts::value_type(dsn, e)); throw; } @@ -190,10 +192,10 @@ RdbmsDataSource::RdbmsConnection::isExpired() const return (time(NULL) > lastUsedTime + keepAliveTime); } -RdbmsDataSource::ConnectionInfo::ConnectionInfo(ScriptNodePtr node) +RdbmsDataSource::ConnectionInfo::ConnectionInfo(ScriptNodePtr node) : + dsn(node->value("dsn").as<std::string>()), + typeId(LoaderBase::getLoader<ConnectionLoader, UnknownConnectionProvider>(node->value("provider"))) { - typeId = LoaderBase::getLoader<ConnectionLoader, UnknownConnectionProvider>(node->value("provider")); - dsn = node->value("dsn").as<std::string>(); } DB::Connection * |