Mercurial > hg > orthanc-databases
comparison Framework/Common/DatabaseManager.cpp @ 119:260fc55f10cd OrthancMySQL-2.0
cancelling changesets 116 and 117 in OrthancMySQL-2.0 branch
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 04 Feb 2019 16:32:45 +0100 |
parents | 569e17419eae |
children |
comparison
equal
deleted
inserted
replaced
117:ca0ecd412988 | 119:260fc55f10cd |
---|---|
19 **/ | 19 **/ |
20 | 20 |
21 | 21 |
22 #include "DatabaseManager.h" | 22 #include "DatabaseManager.h" |
23 | 23 |
24 #include <Plugins/Samples/Common/OrthancPluginCppWrapper.h> | |
25 | |
26 #include <Core/Logging.h> | 24 #include <Core/Logging.h> |
27 #include <Core/OrthancException.h> | 25 #include <Core/OrthancException.h> |
28 | 26 |
29 #include <boost/thread.hpp> | 27 #include <boost/thread.hpp> |
30 | 28 |
510 assert(statement_ == NULL); | 508 assert(statement_ == NULL); |
511 statement_ = &GetManager().CacheStatement(location_, *query); | 509 statement_ = &GetManager().CacheStatement(location_, *query); |
512 } | 510 } |
513 | 511 |
514 assert(statement_ != NULL); | 512 assert(statement_ != NULL); |
515 | |
516 /* | |
517 TODO - Sample code to monitor the execution time of each | |
518 cached statement, and publish it as an Orthanc metrics | |
519 | |
520 #if HAS_ORTHANC_PLUGIN_METRICS == 1 | |
521 std::string name = (std::string(location_.GetFile()) + "_" + | |
522 boost::lexical_cast<std::string>(location_.GetLine())); | |
523 OrthancPlugins::MetricsTimer timer(name.c_str()); | |
524 #endif | |
525 */ | |
526 | |
527 SetResult(GetTransaction().Execute(*statement_, parameters)); | 513 SetResult(GetTransaction().Execute(*statement_, parameters)); |
528 } | 514 } |
529 catch (Orthanc::OrthancException& e) | 515 catch (Orthanc::OrthancException& e) |
530 { | 516 { |
531 GetManager().CloseIfUnavailable(e.GetErrorCode()); | 517 GetManager().CloseIfUnavailable(e.GetErrorCode()); |