]> granicus.if.org Git - icinga2/commitdiff
Fix PostgreSQL warnings on startup v2.4.8
authorGunnar Beutner <gunnar.beutner@netways.de>
Tue, 17 May 2016 08:32:38 +0000 (10:32 +0200)
committerGunnar Beutner <gunnar.beutner@netways.de>
Tue, 17 May 2016 08:34:42 +0000 (10:34 +0200)
fixes #11798

lib/db_ido_mysql/idomysqlconnection.cpp
lib/db_ido_pgsql/idopgsqlconnection.cpp

index a71e7b3890b7dcb88432b4f28a51b2c9a6502cfd..fefaa918301e36ebe8cb4a6be3a2e007bb2298fb 100644 (file)
@@ -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")
index 93f72f9d11e0004da59c8936787a7f25dd9c2fea..6bd6f0332d3025c31e956bb8dff3a3ba966ae36c 100644 (file)
@@ -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")