CDatabase::Close is not happening
-
Hi, I am establishing a connection with the postgres database when my application comes up. And closing the connection during the exit of my application. But some times during the exit, application hangs in the "database.close()" statement. i.e. Execution is not moving to the next line. even for 2 days it stays there in the same close statement. Any help would be appreciated. Thanks in advance...
Selva
-
Hi, I am establishing a connection with the postgres database when my application comes up. And closing the connection during the exit of my application. But some times during the exit, application hangs in the "database.close()" statement. i.e. Execution is not moving to the next line. even for 2 days it stays there in the same close statement. Any help would be appreciated. Thanks in advance...
Selva
First of all, let me salute your patience. 2 days? Not bad. You don't need an explicit close() since it's taken care of in the destructor if it's still open. (Of course, you need to delete the CDatabase object if it's allocated in the heap.) Try without, and see what happens. You should be able to call close() multiple times, so there is probably something fishy in you code (or ODBC driver).