[icinga-checkins] icinga.org: icinga-core/mbrooks/core: idoutils: fix increasing open cursors introduced with workaround for #1638

git at icinga.org git at icinga.org
Fri Jul 29 00:39:59 CEST 2011


Module: icinga-core
Branch: mbrooks/core
Commit: 5ed6a8ab894391440c3adca10f3d3014d4bfc043
URL:    https://git.icinga.org/?p=icinga-core.git;a=commit;h=5ed6a8ab894391440c3adca10f3d3014d4bfc043

Author: Thomas Dressler <tdressler at tdressler.net>
Date:   Wed Jul 13 19:19:38 2011 +0200

idoutils: fix increasing open cursors introduced with workaround for #1638
refs #1638

---

 module/idoutils/src/dbhandlers.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/module/idoutils/src/dbhandlers.c b/module/idoutils/src/dbhandlers.c
index e18908b..89cc56f 100644
--- a/module/idoutils/src/dbhandlers.c
+++ b/module/idoutils/src/dbhandlers.c
@@ -271,6 +271,7 @@ int ido2db_get_object_id_with_insert(ido2db_idi *idi, int object_type, char *n1,
 	char *es[2];
 #ifdef USE_ORACLE
 	void *data[4];
+	char * fname="get_object_id_with_insert";
 #endif
         ido2db_log_debug_info(IDO2DB_DEBUGL_PROCESSINFO, 2, "ido2db_get_object_id_with_insert() start\n");
 
@@ -397,8 +398,12 @@ int ido2db_get_object_id_with_insert(ido2db_idi *idi, int object_type, char *n1,
 		 ido2db_log_debug_info(IDO2DB_DEBUGL_PROCESSINFO, 2, "ido2db_get_object_id_with_insert() extra prepare failed\n");
 		 return IDO_ERROR;
 	}
+
 	OCI_RegisterUnsignedInt(st,MT(":id"));
+	//free old and reassign
+	ido2db_oci_statement_free(idi->dbinfo.oci_statement_objects_insert,fname);
 	idi->dbinfo.oci_statement_objects_insert=st;
+
 	/* --end workaround-- */
 
 	ido2db_log_debug_info(IDO2DB_DEBUGL_PROCESSINFO, 2, "ido2db_get_object_id_with_insert() Bind instance id %lu\n",idi->dbinfo.instance_id);





More information about the icinga-checkins mailing list