]> git.sur5r.net Git - bacula/bacula/commitdiff
Lets close the session based on session_id so we close the session we want to close...
authorMarco van Wieringen <mvw@planets.elm.net>
Sat, 3 Apr 2010 21:00:29 +0000 (23:00 +0200)
committerMarco van Wieringen <mvw@planets.elm.net>
Fri, 9 Apr 2010 11:28:02 +0000 (13:28 +0200)
bacula/src/cats/myingres.sc

index 898a9a61fb7a7a67cc5ef9257d2a5e890b478b97..cf1678dce05cf351e88cb156fbcaa33e3e5bc9d8 100644 (file)
@@ -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);