[icinga-checkins] icinga.org: icinga2/master: Fix PostgreSQL warnings on startup

git at icinga.org git at icinga.org
Tue May 17 10:33:09 CEST 2016


Module: icinga2
Branch: master
Commit: 93da47a67056996e88af4371282942ca54b2d8b7
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=93da47a67056996e88af4371282942ca54b2d8b7

Author: Gunnar Beutner <gunnar.beutner at netways.de>
Date:   Tue May 17 10:32:38 2016 +0200

Fix PostgreSQL warnings on startup

fixes #11798

---

 lib/db_ido_mysql/idomysqlconnection.cpp |    4 ++--
 lib/db_ido_pgsql/idopgsqlconnection.cpp |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/db_ido_mysql/idomysqlconnection.cpp b/lib/db_ido_mysql/idomysqlconnection.cpp
index 20af6a4..78f259a 100644
--- a/lib/db_ido_mysql/idomysqlconnection.cpp
+++ b/lib/db_ido_mysql/idomysqlconnection.cpp
@@ -356,6 +356,8 @@ void IdoMysqlConnection::Reconnect(void)
 	/* set session time zone to utc */
 	Query("SET SESSION TIME_ZONE='+00:00'");
 
+	Query("BEGIN");
+
 	/* update programstatus table */
 	UpdateProgramStatus();
 
@@ -389,8 +391,6 @@ void IdoMysqlConnection::Reconnect(void)
 			activeDbObjs.push_back(dbobj);
 	}
 
-	Query("BEGIN");
-
 	BOOST_FOREACH(const DbObject::Ptr& dbobj, activeDbObjs) {
 		if (dbobj->GetObject() == NULL) {
 			Log(LogNotice, "IdoMysqlConnection")
diff --git a/lib/db_ido_pgsql/idopgsqlconnection.cpp b/lib/db_ido_pgsql/idopgsqlconnection.cpp
index 93f72f9..6bd6f03 100644
--- a/lib/db_ido_pgsql/idopgsqlconnection.cpp
+++ b/lib/db_ido_pgsql/idopgsqlconnection.cpp
@@ -324,6 +324,8 @@ void IdoPgsqlConnection::Reconnect(void)
 	Log(LogInformation, "IdoPgsqlConnection")
 	    << "pgSQL IDO instance id: " << static_cast<long>(m_InstanceID) << " (schema version: '" + version + "')";
 
+	Query("BEGIN");
+
 	/* update programstatus table */
 	UpdateProgramStatus();
 
@@ -360,8 +362,6 @@ void IdoPgsqlConnection::Reconnect(void)
 			activeDbObjs.push_back(dbobj);
 	}
 
-	Query("BEGIN");
-
 	BOOST_FOREACH(const DbObject::Ptr& dbobj, activeDbObjs) {
 		if (dbobj->GetObject() == NULL) {
 			Log(LogNotice, "IdoPgsqlConnection")



More information about the icinga-checkins mailing list