db2commexitDeregister API - Deregistration

This function releases the agent from the connection with which it was associated. It is applicable only in communication buffer exit libraries.

This function is called by the database manager whenever the agent stops handling requests on the connection. This situation occurs when the physical connection with the client is terminated, or the client is idle and the agent is disassociating with it.

API header file

db2commexit.h

API and data structure syntax

SQL_API_RC ( SQL_API_FN * db2commexitDeregister )
(
   void                          * pConnectionContext,
   const db2commexitCommInfo_v1  * pCommInfo,
   db2int32                        state,
   db2int64                      * pReservedFlags,
   char                         ** errormsg,
   db2int32                      * errormsglen
);

db2commexitDeregister API Parameters

pConnectionContext
Input. A pointer to communication buffer exit library-specific data. This pointer is specific to the inbound connection. This parameter is passed as input to each function call for that connection. The database manager cannot access the memory pointed to by this parameter. This memory must be deallocated by this function.
pCommInfo
Input. A pointer to a structure that contains information which identifies the database server and protocol-specific information for the incoming connection.
State
Input. Indicates under which condition the function is called. Possible values are
  • CONNECTION_TERM - indicates that the physical connection with the client is terminated.
  • AGENT_DISASSOCIATION - indicates that the client connection is idle and the agent is disassociated from it.
pReservedFlags
Input/Output. Reserved for future use. The value must be set to 0 on output.
errormsg
Output. A pointer to the address of an ASCII error message string that is allocated by the communication buffer exit library. This error messages string might be returned in this parameter if the function execution is not successful. This memory is not freed by calling db2commexitFreeErrormsg.
errormsglen
Output. A pointer to an integer that indicates the length, in bytes, of the error message string in the errormsg parameter.