mirror of https://github.com/Icinga/icinga2.git
parent
a4b2c2134d
commit
933ac5f403
|
@ -138,6 +138,8 @@ void IdoMysqlConnection::Reconnect(void)
|
||||||
reconnect = true;
|
reconnect = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ClearIDCache();
|
||||||
|
|
||||||
String ihost, iuser, ipasswd, idb;
|
String ihost, iuser, ipasswd, idb;
|
||||||
const char *host, *user , *passwd, *db;
|
const char *host, *user , *passwd, *db;
|
||||||
long port;
|
long port;
|
||||||
|
@ -587,6 +589,7 @@ void IdoMysqlConnection::InternalExecuteQuery(const DbQuery& query)
|
||||||
if (type == DbQueryInsert && query.ConfigUpdate)
|
if (type == DbQueryInsert && query.ConfigUpdate)
|
||||||
SetInsertID(query.Object, GetLastInsertID());
|
SetInsertID(query.Object, GetLastInsertID());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type == DbQueryInsert && query.Table == "notifications") { // FIXME remove hardcoded table name
|
if (type == DbQueryInsert && query.Table == "notifications") { // FIXME remove hardcoded table name
|
||||||
m_LastNotificationID = GetLastInsertID();
|
m_LastNotificationID = GetLastInsertID();
|
||||||
Log(LogDebug, "db_ido", "saving contactnotification notification_id=" + Convert::ToString(static_cast<long>(m_LastNotificationID)));
|
Log(LogDebug, "db_ido", "saving contactnotification notification_id=" + Convert::ToString(static_cast<long>(m_LastNotificationID)));
|
||||||
|
|
|
@ -139,6 +139,8 @@ void IdoPgsqlConnection::Reconnect(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ClearIDCache();
|
||||||
|
|
||||||
String ihost, iport, iuser, ipasswd, idb;
|
String ihost, iport, iuser, ipasswd, idb;
|
||||||
const char *host, *port, *user , *passwd, *db;
|
const char *host, *port, *user , *passwd, *db;
|
||||||
|
|
||||||
|
|
|
@ -201,6 +201,12 @@ DbReference DbConnection::GetInsertID(const DbObject::Ptr& dbobj) const
|
||||||
return it->second;
|
return it->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DbConnection::ClearIDCache(void)
|
||||||
|
{
|
||||||
|
m_ObjectIDs.clear();
|
||||||
|
m_InsertIDs.clear();
|
||||||
|
}
|
||||||
|
|
||||||
void DbConnection::SetConfigUpdate(const DbObject::Ptr& dbobj, bool hasupdate)
|
void DbConnection::SetConfigUpdate(const DbObject::Ptr& dbobj, bool hasupdate)
|
||||||
{
|
{
|
||||||
if (hasupdate)
|
if (hasupdate)
|
||||||
|
|
|
@ -47,6 +47,8 @@ public:
|
||||||
void SetInsertID(const DbObject::Ptr& dbobj, const DbReference& dbref);
|
void SetInsertID(const DbObject::Ptr& dbobj, const DbReference& dbref);
|
||||||
DbReference GetInsertID(const DbObject::Ptr& dbobj) const;
|
DbReference GetInsertID(const DbObject::Ptr& dbobj) const;
|
||||||
|
|
||||||
|
void ClearIDCache(void);
|
||||||
|
|
||||||
void SetConfigUpdate(const DbObject::Ptr& dbobj, bool hasupdate);
|
void SetConfigUpdate(const DbObject::Ptr& dbobj, bool hasupdate);
|
||||||
bool GetConfigUpdate(const DbObject::Ptr& dbobj) const;
|
bool GetConfigUpdate(const DbObject::Ptr& dbobj) const;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue