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

git at icinga.org git at icinga.org
Tue May 17 11:44:14 CEST 2016


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

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 a71e7b3..fefaa91 100644
--- a/lib/db_ido_mysql/idomysqlconnection.cpp
+++ b/lib/db_ido_mysql/idomysqlconnection.cpp
@@ -337,6 +337,8 @@ void IdoMysqlConnection::Reconnect(void)
 	/* set session time zone to utc */
 	Query("SET SESSION TIME_ZONE='+00:00'");
 
+	Query("BEGIN");
+
 	/* update programstatus table */
 	UpdateProgramStatus();
 
@@ -370,8 +372,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