2. OpenAPI Function Reference : OpenAPI Functions : IIapi_releaseEnv() Function—Release Resources Associated with Environment Handle
 
Share this page                  
IIapi_releaseEnv() Function—Release Resources Associated with Environment Handle
The IIapi_releaseEnv() function frees an environment handle and any resources associated with the environment handle.
An application calls IIapi_releaseEnv() to free an environment handle allocated by IIapi_initialize(). Any active server connections associated with the environment handle are aborted and the respective connection handle is freed, as are all associated transaction, statement, and database event handles. While this function can be used to clean up quickly after a connection failure, applications are encouraged to continue calling IIapi_close(), IIapi_commit() or IIapi_rollback() and IIapi_disconnect() to cleanly shut down server connections. A warning status is returned if a connection is aborted.
The application can continue to make OpenAPI function calls after calling this function, but does so in the context of the default environment handle shared by all IIAPI_VERSION_1 applications. The application must still call IIapi_terminate() to release global resources used by OpenAPI.
This function has the following syntax:
II_VOID IIapi_releaseEnv (IIAPI_RELENVPARM *relEnvParm);
typedef struct _IIAPI_RELENVPARM
{
       II_PTR             re_envHandle:
       IIAPI_STATUS       re_status;
} IIAPI_RELENVPARM;
This function has the following parameters:
re_envHandle
Type: input
Specifies the environment handle for which resources should be freed.
re_status
Type: output
Specifies the status of the function upon its return. Its value is one of the following:
IIAPI_ST_SUCCESS
IIAPI_ST_FAILURE
IIAPI_ST_NOT_INITIALIZED
IIAPI_ST_INVALID_HANDLE