db2ACSTerminate - terminate a Db2 Advanced Copy Services (ACS) session

Terminates a Db2 Advanced Copy Services (ACS) session.

Include file

db2ACSApi.h

Syntax and data structures


/* ==========================================================================
 * Session Termination
 * ========================================================================== */
db2ACS_RC db2ACSTerminate(
               db2ACS_CB               * pControlBlock,
               db2ACS_ReturnCode       * pRC );

Parameters

pControlBlock
Data type: db2ACS_CB *

db2ACS_CB contains fundamental information required to initialize and terminate a Db2 ACS session.

The database manager allocated the memory for this parameter before calling db2ACSInitialize(). The database manager is responsible for freeing this memory after db2ACSTerminate().

Before calling db2ACSTerminate(), the database manager populates the following fields:

     pControlBlock->options

The Db2 ACS API driver might invalidate and free the memory in pControlBlock->vendorInfo.vendorCB.

pRC
Data type: db2ACS_ReturnCode *

db2ACS_ReturnCode contains diagnostic information including message text and error codes specific to the storage hardware. The contents of a db2ACS_ReturnCode parameter for a Db2 ACS API function call will be recorded in the database manager diagnostic logs.

The database manager allocates the memory for this parameter, and passes a pointer to that instantiated object to the function. The database manager is responsible for freeing this memory.

The Db2 ACS API driver populates the fields of pRC before returning.

Return Codes

Table 1. Return codes
Return code Description Notes
DB2ACS_RC_OK The operation was successful. Free all memory allocated for this session and terminate.
DB2ACS_INV_ACTION The database manager requested an action from the Db2 ACS API driver that is invalid. The Db2 ACS API driver encountered an error. The database manager cannot use the Db2 ACS API session.
If the Db2 ACS API driver encounters an error, the driver might abort a Db2 ACS operation. The Db2 ACS session cannot be used for any action other than the following:
  • If a call to db2ACSBeginQuery() previously succeeded the database manager can call db2ACSEndQuery()
  • If a call to db2ACSBeginOperation() previously succeeded, the database manager can call db2ACSEndOperation()
  • If a call to db2ACSInitialize() previously succeeded, the database manager can call db2ACSTerminate()

For more information about Db2 ACS API return codes, see the topic: Db2 Advanced Copy Services (ACS) API return codes.

Usage notes

The Db2 ACS API driver should free all memory that the driver allocated for the Db2 ACS session in db2ACSTerminate().

Regardless of whether db2ACSTerminate() completes without error, the database manager cannot call any Db2 ACS functions on this Db2 ACS session again, without first calling db2ACSInitialize().