From 7a0173e2fb557ac452444b37872b5a791aebb450 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Wed, 28 May 2014 09:39:38 +0000 Subject: [PATCH] monitoring/IdoQuery: IDO version is cached in a session namespace. This fails where you are using multiple IDO backends with different versions. We still have no backend-specific base class where we could handle this, so for now I continue to do so in the IdoQuery. This patch creates one namespace per Host/dbname combination. --- .../library/Monitoring/Backend/Ido/Query/IdoQuery.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/IdoQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/IdoQuery.php index 471856775..f48ab7b6c 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/IdoQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/IdoQuery.php @@ -599,11 +599,13 @@ abstract class IdoQuery extends Query protected function getIdoVersion() { if (self::$idoVersion === null) { + $dbconf = $this->db->getConfig(); + $id = $dbconf['host'] . '/' . $dbconf['dbname']; $session = null; if (Icinga::app()->isWeb()) { // TODO: Once we have version per connection we should choose a // namespace based on resource name - $session = Session::getSession()->getNamespace('monitoring/ido'); + $session = Session::getSession()->getNamespace('monitoring/ido/' . $id); if (isset($session->version)) { self::$idoVersion = $session->version; return self::$idoVersion;