17.10 - Terminating a Session - Call-Level Interface Version 2

Teradata® Call-Level Interface Version 2 Reference for Workstation-Attached Systems

Product
Call-Level Interface Version 2
Release Number
17.10
Release Date
October 2021
Content Type
Programming Reference
Publication ID
B035-2418-061K
Language
English (United States)

After all processing is complete for a session, the application should terminate the session.

If a transaction is in progress at the time of the disconnect (that is, no ET has been issued), the Teradata Server will roll back any work done for the transaction.

Application

In the DBCAREA, the application supplies the session id of the session to be terminated and sets the function code to disconnect (DBFDSC). Then it calls DBCHCL.

DBCHCL

DBCHCL generates a dummy request (including RCB and buffers). DBCHCL builds a Logoff parcel in the message body part of the Request Buffer for the dummy request. DBCHCL then sets the function code in the MTDP Control Block to MTDPLOFF and calls MTDP.

MTDP

MTDP terminates the session and then returns control to DBCHCL.

DBCHCL

All the requests attached to the disconnected session are removed by deallocating their buffers and RCBs, and then the associated SCB are removed from the session queue and returns it to the free memory pool. DBCHCL then returns a success code to the application program. If the return code in the MTDP Control Block is abnormal, DBCHCL returns an error message to the application.

Application

If the return code in the DBCAREA is not normal the application makes the appropriate changes and re-submits the DBCAREA to DBCHCL, as described above. Otherwise, the session is terminated.