Shutting down the connector

In the C++ connector library, the terminate() method is defined in the GenGlobals class. Typical return codes used in terminate() are BON_SUCCESS and BON_FAIL.

Note:
It is important that the terminate() method for a C++ connector free allocated memory and close the connection with the application.

Figure 76 shows a sample terminate() method for a C++ connector.

Figure 76. C++ terminate() method

int ExampleGenGlob::terminate()
{
   // log off application and 
   // release memory and other resources
   ...
 
   traceWrite(Tracing::LEVEL3, "terminate() completed.", 0);
   return BON_SUCCESS;
}

Copyright IBM Corp. 1997, 2004