From f3c6e021a48cff1bf5337eca37f471b2bb58a204 Mon Sep 17 00:00:00 2001 From: Marco van Wieringen Date: Sat, 3 Apr 2010 23:00:29 +0200 Subject: [PATCH] Lets close the session based on session_id so we close the session we want to close not just an active connection. --- bacula/src/cats/myingres.sc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/bacula/src/cats/myingres.sc b/bacula/src/cats/myingres.sc index 898a9a61fb..cf1678dce0 100644 --- a/bacula/src/cats/myingres.sc +++ b/bacula/src/cats/myingres.sc @@ -591,10 +591,14 @@ INGconn *INGconnectDB(char *dbname, char *user, char *passwd) void INGdisconnectDB(INGconn *dbconn) { - /* - * TODO: check for any real use of dbconn: maybe whenn multithreaded? - */ - EXEC SQL DISCONNECT; + EXEC SQL BEGIN DECLARE SECTION; + int sess_id; + EXEC SQL END DECLARE SECTION; + + sess_id = dbconn->session_id; + + EXEC SQL DISCONNECT SESSION :sess_id; + if (dbconn != NULL) { free(dbconn->msg); free(dbconn); -- 2.39.5